S
SuzyQ
I have a need to write data to a file in a fixed length or delimited file.
How can I write data to disk in a format that I can specify?
How can I write data to disk in a format that I can specify?
SuzyQ said:I have a need to write data to a file in a fixed length or delimited file.
How can I write data to disk in a format that I can specify?
__________ Information from ESET Smart Security, version of virus
signature database 4022 (20090420) __________
The message was checked by ESET Smart Security.
http://www.eset.com
Larry Linson said:In "classic Access" (Access 2003 and earlier and assuming that the data you
want to write to a file as fixed length or as a delimited file is in either
an Access Table or an Access Query):
(1) In the Database Window, select the Table or Query,
(2) In the File Menu, click Export
(3) In the Save As dialog that pops up, in the "Save as Type" box, choose
"Text Files (*.txt, *.csv, *.tab, *.asc)"
(4) In the Export Text Wizard that pops up, you can choose "Delimited" or
"Fixed", and, with the prompts that follow, you have outstanding control
over the format, particularly if you use the "Advanced" button.
It may take a little "exploration" to get it just as you want it
(particularly in fixed format), but the only problems I've had with it was
when I was receiving files and they were not consistent in their formatting
(which meant that my saved format had to be changed with some frequency).
This could also be done with VBA code, using DAO (or even <UGH!> ADO) to
read the Table or Query, and File I/O statements in VBA to write to the
file, but that would be a lot more time and effort for any reasonably
"normal" export.
Larry Linson
Microsoft Office Access MVP
__________ Information from ESET Smart Security, version of virus signature database 4022 (20090420) __________
The message was checked by ESET Smart Security.
http://www.eset.com
I can get it to be comma delimited using transfertext, but how do I get it
fixed width using transfertext? I need it to create a specific file format
that can be imported to relic of a system.
Armen Stein said:See http://www.applecore99.com/gen/gen029.asp for an overview of
available functions. It's pretty sparse though - maybe someone else
has a good reference for these functions?