Question Fields in fixed width imported txt file get truncated

Quacker

New member
Local time
Yesterday, 21:17
Joined
Nov 18, 2010
Messages
3
Hi,
I frequently have a need to import fixed width txt data into Access tables for analysis and have built many import/export specs to accommodate them. I recently had a need to import a 1300 byte record into Access so I could correct some specific data fields with the expectation to export them back out with corrected data.

I created an import spec that defined the fields I was concerned with and left the fields I didn't care about as large blocks of data defined in the import spec as long text. The entire record was imported - nothing skipped. After manipulating the fields I cared about I exported the modified data using the same spec. However the exported txt file was reformatted in a way that made it clear that some of the long text fields had been truncated. Essentially data fields were shifted from their original positions in the file. FYI, the txt file that I input had actual blanks and not white space separating distinct data fields and the fields were all padded with spaces to the field lengths and the end of the record.

The only way I could get around this issue was to utilize a more granular import spec that defined all of the dozens of fields in the txt file (fortunately I already had one created) and then export the data with the same spec after manipulation. Has anyone else encountered this issue? If so how do you get around it? I'm not a VB programmer so any workaround would need to exclude VB solutions until I realize I really need to get off the pot and learn VB.
 
If you try to export a memo field, it will truncate. (thank you Microsoft)

Now this is true for queries, I think you can export direct from a table and it will keep the entire value.
I hit this wall too, and its a pain. Didnt Microsoft think we would want ALL the data?
 
Thanks for the info Ranman. I didn't try exporting the table directly. When importing I allowed Access to generate a key as it made my data manipulation much easier. I didn't want the generated key to show up in my export txt file so I was exporting a query result. I'll keep this tip in mind next time.
 

Users who are viewing this thread

Back
Top Bottom