Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delimited text output without quotes?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00292190
Message ID:
00292888
Views:
18
Neil,

1) If the file isn't huge (less than a couple of megs):

copy to file.txt type csv
x1 = filetostr( "file.txt" )
strtofile( chrtran( x1, ["], [] ), file.txt )

the above code is way nasty with huge strings because VFP is slogging around lots and lots of bytes. You can use aline() and chrtran() each row of the array and use the lowlevel routines to output the lines

2) Use the TEXTMERGE command

>How can you create a comma-delimited text file without the double quote characters around text fields in VFP6?
>
>I need to create a csv file for use with another application that requires comma separated values, but won't accept the character fields in quotes. I have tried every combination of COPY TO DELIMITED WITH CHARACTER and variations I could think of based on VFP6 Help and the Hacker's Guide entry.
>
>
COPY TO file.txt TYPE DELIMITED WITH BLANK
writes a file having quotes around each text field, separated by a blank space (Contrary to the Hacker's Guide).
>
>
COPY TO file.txt TYPE DELIMITED WITH BLANK WITH CHARACTER ,
generates a syntax error, while
>
>
COPY TO file.txt TYPE DELIMITED WITH ~ WITH CHARACTER ,
creates the file having text fields enclosed in ~ and separated by commas.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform