in reply to Re (tilly) 1: csv output
in thread csv output

and " can appear doubled.

Ouch, that hurts. Mastering Regular Expressions assumes " can be escaped with a backslash.

The regex the book uses is:

"([^"\\]*(\\.[^"\\]*)*)",?|([^,]+),?|,
Would that introduce Microsoft-incompatability?

U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk

Replies are listed 'Best First'.
Re (tilly) 3: csv output
by tilly (Archbishop) on Mar 14, 2002 at 19:53 UTC
    Save the following in your text editor and open in Excel to verify the incompatibility.
    hello,world "this","is "",test 1" "this","is \",test 2" "this","is "" test 3" "this","is \" test 4"
    Note in particular the unusual handling of the even tests.

      That would require me to install Microsoft Windows and acquire and install Microsoft Excel. Could you please tell me how they will be handled?

      U28geW91IGNhbiBhbGwgcm90MTMgY
      W5kIHBhY2soKS4gQnV0IGRvIHlvdS
      ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
      geW91IHNlZSBpdD8gIC0tIEp1ZXJk
      

        Ah, small problem. The result is as follows:
        helloworld
        thisis ",test 1
        thisis \test 2"
        thisis " test 3
        thisis \ test 4"
        As you see, Excel does not exactly agree with Friedl on what CSV format looks like...