Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CSV and double quotes
Message
From
15/04/2015 09:59:00
 
 
To
13/04/2015 04:49:18
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01618070
Message ID:
01618451
Views:
50
>>I'm amazed that nobody here has EVER in the past decade made a comment about this incorrect behavior. There are several posts about the problem, but never it was said that it's a bug, including your posts.
>>
>>It is important for developers to be aware of the incorrect behavior, because it makes it a requirement to do no direct COPY TO TYPE CSV or APPEND FROM TYPE CSV. Instead, one should write a bug-aware function that does create or read.
>
>The point here is that the format is "value","value",number,"value" etc etc - i.e. the strings are surrounded with quotation marks. So whatever imports these, expects that the string value is whatever bytes there are after the quotation marks until the next quotation mark is met. Now if your string value contains one, tough luck.
>
>It's the same problem with memo fields in a text file, when you have the CR and/or LF as record delimiters, and yet a memo field in a record also contains one.
>
>Basically, the eternal problem of distinguishing between content and packaging, because the content contains some of the packaging. So they introduce various escape sequences (like duplicating apostrophes in SQL, prefixing formatting stuff with backslashes and wrapping the blocks with braces in RTF, introducing entities in HTML etc etc) so that there's a way to distinguish between the content and the wrapper, which is basically a contract between the sender and the recever. And then someone wants to have the packaging as content (i.e. your text is about the wrapper, your RTF text contains examples of RTF codes, your HTML is an article about HTML syntax).
>
>Over the last 20+ years I had to export, and more frequently import, data in various text formats, and the most frequent situation was that I had to reverse engineer that contract, i.e. to guess the rules used to create the text. The most frequent solution was something beginning with FileToStr()... and a lot of chrtran(), strtran(), aLines(). Append from... works only for simplest cases, which were always rare.

Dragan, that's a long text, but was I miss is your admission that VFP's implementation contains a bug.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform