in reply to Re^6: csv with parens that include commas
in thread csv'ish string with parens that include commas

It was not the answer to what was asked.

Yes it was (the code proves it).

Was it helpful or necessary to call my question NO-GO?I use perl in scientific/engineering work, so I am sorry if I am not properly describing CSV.

Yes. CSV is a known format and there are standard tools for dealing with it.

Much like dealing with XML-ish data, using standard XML tools is a no-go situation. They will insist on doing their job (like abort because of XML syntax errors) and not DWIM.

Heck, the following will work for the original question, but it won't for CSV (or the real (and undefspecified) problem)

$ perl -le"print for split /,/, q!sue,fred,x(mary,jane)!, 3" sue fred x(mary,jane)

Replies are listed 'Best First'.
Re^8: csv with parens that include commas
by BrowserUk (Patriarch) on Dec 05, 2010 at 22:55 UTC
    Yes. CSV is a known format and there are standard tools for dealing with it. Much like dealing with XML-ish data,

    The "CSV format" is totally unlike "the XML format" in that there is no single "CSV format definition".

    Whilst the Internet Society took it upon themselves to impose a copyrighted, band-wagon "standard" upon the CSV label circa 2005, the simple expedient of separating data fields by an exclusive delimiter pre-dated that puerile attempt by nearly 40 years.

    Usurping the term and imposing a unilaterally decided definition upon it--and then having the arrogance to copyright it, 38 years after the fact--is exactly as asinine as it sounds.

    Attempting to use that backronistic arrogance to win a pointless argument, gives a whole new connotation to the term pedantic shit.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Dear Mr Buttinski, I'm not trying to win arguments.