Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CSV with double quotes
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01648804
Message ID:
01648873
Views:
51
>We have an old system which exports a set of records to an XLS spreadsheet. Because of the record limitation in COPY XLS we export the table in chunks of 60,000 records. Currently, this means three separate spreadsheets are exported.
>
>The user has requested that only one file be generated.
>
>I did a COPY TO CSV. But that runs into issues because some of the fields have embedded double-quote characters in the value. For example, a description field that is
>width = 5" and height = 5.5" and color = "red"
>and the double-quote is breaking the intended format of the result.
>
>I could probably write something that opens an instance of Excel and then writes cell by cell, but that has a different set of issues.
>
>I can also go through the table and CHRTRAN the double-quotes into a pair of double-quotes. That seems to clear the immediate issue.
>
>Is there some other "COPY" or "EXPORT" command that I can use to get the desired result? Or some completely different process?
>
>All advice welcome.
>
>............Rich

This gets rid of the dang double quote problem....

COPY to myfile.csv delimited with "" with character '|'

...if you do that command it creates a file without those stupid quote marks, delimited with the pipe symbol.

...Sorry I was late to the game here I didn't notice the thread till just now - but perhaps this can help you out now or in the future. This is one quirk that got me stuck in the past.
ICQ 10556 (ya), 254117
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform