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!

Append Delimited

Status
Not open for further replies.

SM777

Technical User
Mar 7, 2001
208
0
0
GB
I append delim from a csv file with the following data:

"harry","100","50","north","5.75"
"george","200","0","south","10.92"

The database structure is

NAME C 20
NUM1 N 5 0
NUM2 N 5 0
LOCN C 20
COST N 5 2

The code is

use IMPORTED
apped from IMPORT.CSV delim

If I use foxpro 2 this works fine, if I use Clipper5.2d it randomly misses the NUM2 field.

I have tried delim with " delim with , delim with ", etc. but I just can't get it to work in Clipper.

TIA
 
I think the problem may be the CSV file using quotes around number fields. It has been a while but maybe this helps.

Ed
 
I suspect thats the answer too.

Guess I'll need to use some kind of fopen file access code to read the files and strip out the quotes. Just wondered if there was a know easy workaround for this problem as foxpro isnt affected.
 
The easiest thing to do, if your inpur file is not very large is to open the file using an editor like NE and find all " and replace with nothing. Then use append with delim and it will work fine.

Subra. if you find this useful let me know at vksubra@usa.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top