INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Copy 2.6 database to csv file without the EOF symbol

Copy 2.6 database to csv file without the EOF symbol

(OP)
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?

RE: Copy 2.6 database to csv file without the EOF symbol

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.

RE: Copy 2.6 database to csv file without the EOF symbol

(OP)
Sorry, yes I should have said CRLF and not <return>

RE: Copy 2.6 database to csv file without the EOF symbol

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.

RE: Copy 2.6 database to csv file without the EOF symbol

(OP)
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

RE: Copy 2.6 database to csv file without the EOF symbol

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close