Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy 2.6 database to csv file without the EOF symbol

Status
Not open for further replies.

frenchpeter

IS-IT--Management
Sep 10, 2002
44
0
0
FR
I have to copy a database to a .csv file (type delimited) which works but adds an EOF symbol (<Return>) in the cell in column A immediately below the data. This is causing problems to the recipient. Is there any way of stopping this?
 
I don't know if legacy foxpro differs from VFP, but COPY TO DELIMITED saves CRLF as end of every record, also the last. There is no EOF, which would be <CTRL+Z>, not <Return>.

A thing, that could help is postprocessing the file with FCHSIZE to make it one byte shorter without needing to rewrite it.

Bye, Olaf.
 
Sorry, yes I should have said CRLF and not <return>
 
Well, that's not EOF, but simply the last end of line/record.
Makes me wonder, which software expects a CSV to NOT end in CRLF in the last line, but if that's the case and FCHSIZE is an available function you can open the newly generated file with FOPEN, FSEEK to the file end to find out the file size and then FCHSIZE() to size-2.

Bye, Olaf.
 
Hi Olaf

The CSV file is to transmit invoice data to one of the many e-commerce services. They seem to expect the file to be generated out of Excel which does not append a CRLF. The problem is that their extraction routines seem to simply trudge though the file until it gets to a blank line. For the moment, therefore, I have simply added some blank records which moves the CRLF away from the last non-blank data record. Thank you for your input - much appreciated.

Kind regards. Peter
 
Well, OK, whatever works. Just notice there is not just one CRLF, every row/record ends in one. Which still makes it quite a riddle, why the last CRLF would cause trouble.

Bye, Olaf.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top