473,652 Members | 3,045 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 4436
NeoPa
32,568 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,568 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,568 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,568 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
1807
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? For example,
5
2064
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
6852
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 replace just one item. I know I can get the entire array, then save the whole thing (with a for loop and if statements so that the changed data will be saved), but it seems like a lot of unnecessary reading and writing. Is there a way to directly save...
3
7658
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 of file structure. The obvious solution would be to use XML file processing however that is not an option as I have a third party vendor that is not capable of processing XML files.
3
4480
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 fixed length strings in the same way. How do you do this in VB.NET? Thanks, Ken ============ Code Snipit ============
3
4700
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 1:
15
1542
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: Tommy 555
1
9412
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 form data in a fixed length structure that is written direct to disk. I need to load the existing files, into a fixed length structure to initialize the form data within the project. I am running into problems with statements like the...
1
3168
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 extract data from text files and import it into datatable. The format of the text file is fixed length/width. Eg. http://img174.imageshack.us/img174/8457/untitledpp4.jpg I am having trouble to do so as I am not sure how to start. I had done...
2
3159
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 d.append((begin, end))
0
8279
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8467
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8589
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5619
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1591
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.