Export to CSV problem

  • Thread starter Thread starter ozlink
  • Start date Start date
O

ozlink

I have a database where I need to export a table to a CSV file.
I can do this using the TransferText command with a export definition.

The problem I have is the program that is going to import the CSV file
requires at the end of each record the following <F9><ESC><F9> as an
unquoted value whilst requiring all other fields to be quoted.


Currently a line from my CSV file looks as follows

"LIOAUS","","140104","I1170","LIOAUS","1","ea","11.6"

I have tried creating a new field in the export table with a default
value of <F9><ESC><F9> however when I export this I get

"LIOAUS","","140104","I1170","LIOAUS","1","ea","11.6","<F9><ESC><F9>"

This is fine apart from the quotes surrounding the <F9><ESC><F9>. The
program where it is going to doesnt like the quotes.
So I need the export to look like

"LIOAUS","","140104","I1170","LIOAUS","1","ea","11.6",<F9><ESC><F9>

Any Ideas

Thanks in Advance

Dave Macphail
 
When there is anything out of the ordinary, I always use low-level I/O to
export my data. Basically, you create a string that is formatted exactly
how you want, then PRINT it to a text file.

On my website (see sig below) is a small sample database called
"ExportFormattedFixed.mdb" which illustrates the basic process.
Unfortunately, this sample exports it as a Fixed Width, but the process can
be modified for CSV. You would simply put quote marks around the fields
that you want delimited and not around those you don't.
 
Back
Top