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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cvs or csv

Status
Not open for further replies.

DEDMOD

Programmer
Feb 1, 2001
721
US
I'm trying to use APPEND FROM to fill some tables from .csv files, but am losing the first record. The VFP help file is confusing as it talks first about a .cvs TYPE and then mentions a .csv file. The files I have don't have a first record consisting of field names, so I'm losing the first record. I tried using TYPE cvs, but VFP doesn't like it. Is there a simple solution, or do I have to insert a duplicate of the first record and lose the first one?

Dave Dardinger
 
CVS vs CSV -> typo in the help.

The problem you encounter has to do with the definition of a CSV-file. The first line is supposed to contain field-names (per definition).

In this case
Code:
APPEND FROM (lcImportFile) DELIMITED WITH CHAR ,
will do the trick. The auto-support for CSV doesn't kick in, so all lines are read, and as field delimiter (or seperator) a ',' is used.
Diederik Vermeeren
verm1864@exact.nl
 
Thanks. :cool: That's sort of the conclusion I was arriving at. Don't know why these files were .csv files when they didn't have the first line they should have, however. --Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top