Export Access Table to Tab Delimited TXT file or fixed

I have done exports to Excel, Dbase etc, but I am having problems with Text files.

I need to export a table to a TAB delimited or fixed-width TXT file.

I have no problem creating the regular delimited (") export, which is the default for Export delimited.

But how do I either do the Export Tab Delimited  or Fixed-Width ? I cannot find anything on what the specificationname should be. I need an example
proffittwareAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
you have to create the ExportSpecification first

to create the export specification  (export spec fixed width)
1.select the table
2.File>export
3. in the Save As Type list, click Text Files (*.txt, *.csv, *.tab, *.asc), and then click Export
4. In the export text wizard select Fixed width
5 .Click Advanced
6. In the Customers Export Specification dialog box Field Information List, correct any descrepancies

7 click save as, give the specification a name  <-- this is the specification name that you will use in the command line below


DoCmd.TransferText acExportFixed, "ExportSpecName", "TableOrqueryName", "C:\mytext.txt", True




0
 
SeanStricklandCommented:
This is Tab Delimited:

DoCmd.TransferText acExportDelim, "", "tableName", "C:\My Documents\TableName.txt", True, ""



A good method to find this out is to create a macro using the TransferText command.  Get that to work and save the macro.  Then right click the macro and use Save As / Export and select Save As Visual Basic Module and it will transfer the macro you created to VBA.

HTH,
Sean
0
 
SeanStricklandCommented:
BTW,

Replace tableName with your Table's name and replace the file location with your own.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
proffittwareAuthor Commented:
Thanks I will try these and get back to you.
0
 
proffittwareAuthor Commented:
That still gave me quotes (") around each field I am exporting.
0
 
proffittwareAuthor Commented:
Capricorn1...once I create this specification name file...if I do this export numerous times can I use it repeatedly ?
0
 
SeanStricklandCommented:
Sorry, I missed that part.  Capricorn has described clearly how to create specificiations.  That's what you need.

My apologies,
Sean
0
 
Rey Obrero (Capricorn1)Commented:
proffittware,

in number 4 of my post., if you selected Delimited

you have to use

DoCmd.TransferText acExportDelim, "ExportSpecName", "TableOrqueryName", "C:\mytext.txt", True

0
 
Rey Obrero (Capricorn1)Commented:
<once I create this specification name file...if I do this export numerous times can I use it repeatedly ?>  YES
0
 
proffittwareAuthor Commented:
Capricorn1: Ok...I did what you suggested for Fixed and it worked.  I tried to apply your instructions to the TAB delimited...it gave me tabs between fields, but it also used (") to delimit the fields.

Here is the DoCmd.

  DoCmd.TransferText acExportDelim, "FTPExportTab Export Specification", "FTPExport", "C:\Canada\exporttab.txt", True, ""
0
 
SeanStricklandConnect With a Mentor Commented:
"but it also used (") to delimit the fields."

Set the Text Qualifier in the wizard to {none}
0
 
proffittwareAuthor Commented:
Sorry about the last comment, did not see your comment of 2:39 ...I will try and get back
0
 
proffittwareAuthor Commented:
Thanks to both for the information.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.