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

Comma Delimited File Create

Status
Not open for further replies.

Atlas

Programmer
Sep 20, 1999
26
US
I need to create a comma delimited file for a vendor for upload into their system. I sent them one file created with the command copy to myfile.csv CSV but they they need a file that does not have charater string surrounded by ".
I have tried different commands but I can seem to get the file to copy without the quotes. Instead of this in the file

"LUFKIN ISD","HELEN STROHSCHEIN","9366346696"

they want this

LUFKIN ISD,HELEN STROHSCHEIN,9366346696

I tried different commands but still can't get this right.

Any help would be appreciated.

Thanks
Atlas

 
I tried the Copy to Delimited with " " got rid of the qoutes but have spaces at beginning and end of each string

003903 , LUFKIN ISD , HELEN STROHSCHEIN , 1806 MARTIN LUTHE , , LUFKIN , TX

want this

003903,LUFKIN ISD,HELEN STROHSCHEIN,1806 MARTIN LUTHE, ,LUFKIN,TX

Tried Copy to Delimited with "" but get error message
Command contains unrecognized command/keyword. Must be doing something wrong.

Thanks

Atlas
 
Atlas,
COPY TO "myfile.txt" DELIMITED WITH ""
Will work as you want it to in VFP 7.0 & 8.0, but isn't syntactically correct in VFP 6.0 (SP5). :-(

If you are stuck in 6.0, you may need to get creative using something like:
Code:
set safety off
xx = chr(127)
COPY TO myfile.txt DELIMITED WITH &xx
strtofile(chrtran(filetostr("myfile.txt"),"&xx",""),"myfile.txt")
set safety on
Rick

 
Hi ATLAS

COPY TO myFile.txt DELIMITED WITH ""

1. no space between the "" marks
2. If you omit the myFile.txt error will be reported.
use myFile.Txt or replace it with filename you want

:)

ramani :)
(Subramanian.G)
 
Thanks to all the code from rgbean does the job. Should have upgraded to VFP 8.0.

thanks

Atlas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top