473,503 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing out a fixed length file

4 New Member
Probably a noob question... Given a set of tables that I have, how is the best way to write out a fixed lenght text file? Do I need to create an empty table that has the fields defined and transfer the data into it?

Thanks,
Kevin
Oct 31 '06 #1
9 4433
NeoPa
32,557 Recognized Expert Moderator MVP
If you use the wizard to export a table, it gives you the option of fixed length or separator characters.
If you go into the Advanced section, it also gives you the option of saving any definition.
If you want to output the data later using code - you can, using the Text layout definition saved then.
Oct 31 '06 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
Probably a noob question... Given a set of tables that I have, how is the best way to write out a fixed lenght text file? Do I need to create an empty table that has the fields defined and transfer the data into it?

Thanks,
Kevin
It can be done using VBA code but it's pretty complicated if you're not that familiar with VBA. If you are come back on this and I'll give you the code.

Otherwise if the tables have the same structure (BTW: If they do they shouldn't be separate tables in a proper database structure), you can do a union query. To do this you have to be in the sql view of the query design.

SELECT * FROM Table1
UNION
SELECT * FROM Table2
UNION
SELECT * FROM Table3;

You can then export the query results.
Oct 31 '06 #3
Killer42
8,435 Recognized Expert Expert
...Otherwise if the tables have the same structure (BTW: If they do they shouldn't be separate tables in a proper database structure) ...
That's assuming, of course, that the silly database software can handle the size of the data. :(
Oct 31 '06 #4
NeoPa
32,557 Recognized Expert Moderator MVP
That's assuming, of course, that the silly database software can handle the size of the data. :(
lol (+padding)
Nov 1 '06 #5
MMcCarthy
14,534 Recognized Expert Moderator MVP
lol (+padding)
Which is why the data should not be in separate tables...

If tkhouk would like some help on structures please post your current structures and we'll do what we can to help.
Nov 1 '06 #6
Killer42
8,435 Recognized Expert Expert
Which is why the data should not be in separate tables...

If tkhouk would like some help on structures please post your current structures and we'll do what we can to help.
Sorry, I was thinking of separate databases. My goof.
Nov 1 '06 #7
NeoPa
32,557 Recognized Expert Moderator MVP
lol - because Killer's data is so large it has to be stored in multiple databases - even though the tables are of the same form.

On that point Killer, did you check the db sizes in your 2K dbs?
Did you also check that all text fields had 'Unicode Compression' set?
Nov 1 '06 #8
Killer42
8,435 Recognized Expert Expert
lol - because Killer's data is so large it has to be stored in multiple databases - even though the tables are of the same form.
Yeah :(
Around 7GB so far, and increasing.
In fact, my memory is finally starting to kick into gear - the size limit used to be 1GB, and then increased to 2GB - a huge relief at the time. I'm almost certain I tried creating an Access 2003 format database in Access 2003, and still had the same limit.

However, if a PK allows the UNION to produce decent results, then it will certainly be much more convenient to work with smaller files.

On that point Killer, did you check the db sizes in your 2K dbs?
Sorry, I'm not sure what you mean. Do you mean the file size of my Access 2000 format databases? If so, yes, they're 2GB as stated.

Did you also check that all text fields had 'Unicode Compression' set?
Yes. (I always make sure I use the unicode compression option.)
Nov 1 '06 #9
NeoPa
32,557 Recognized Expert Moderator MVP
Killer,

You should seriously consider porting your back end database to SQL Server 2005.
I believe the free version is now much more flexible than the 2K MSDE.
It will handle your databases (/tables) without strain.
Unfortunately, the SQL Server forums are not as active as these here in the Access section (No MM of course).

PS. Sorry about the 2GB limit - I thought it had gone from 2GB to 4GB. It must have been from 1GB to 2GB.
Nov 1 '06 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1802
by: Thierry Lam | last post by:
Let's say I already wrote a file and have the following: testing testing testing testing testing testing Is there an easy way to write something of variable length at the top of the file? ...
5
2058
by: Venkat | last post by:
Hi, I need to read a file and simultaneously modify the same file , i.e, read a file and then change some contents in it and then save it once again. How do I do this? Thanks,
2
6839
by: melanieab | last post by:
Hi, I'm trying to store all of my data into one file (there're about 140 things to keep track of). I have no problem reading a specific string from the array file, but I wasn't sure how to...
3
7646
by: ecov | last post by:
Is there any easy way to read into a dataset a file that was created from a BCP command. The file is in a fixed length format. I would also like to be able to write out a dataset to the same type...
3
4465
by: KLomax | last post by:
VB6 allowed you to define User types that you could write to file using the statement. This is a nice way to generate fixed length text files. See Below. VB.NET does not support UserTypes with...
3
4685
by: Marco Herrn | last post by:
Hi, I have a text file with some lines in it. Now I want to iterate over this file and exchange some lines with some others. I tried this approach: try: myfile= file('myfile', 'r+') while...
15
1527
by: Tommy B | last post by:
I was wondering if there was a way to take a txt file and, while keeping most of it, replace only one line. See, I'd have a file like: Tommy 555 Bob 62 Joe 529 And I'd want to set it to be:...
1
9399
by: Rick Knospler | last post by:
I am trying to convert a vb6 project to vb.net. The conversion worked for the most part except for the fixed length strings and fixed length string arrays. Bascially the vb6 programmer stored all...
1
3163
by: kendrick82 | last post by:
Hi, I would like to seek some advise and assistance regarding the following matter as I am new to VB.Net. I'll appreciate any helps render. I am developing a VB application using VB.Net 2003 to...
2
3145
by: Edwin.Madari | last post by:
#your thought is right. ======================================================= def sizes2fields(sizes): d = begin = 0 for i in sizes: if begin: end = begin + i else: end = i...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.