Hopefully this will help you on your trouble shooting, but I get the correct result (e.g. The first set (1 & 6)of double quotes signify a text field that allows embedded commas and the second (2 & 5)and third sets (3 & 4) of double quotes signify an embedded double quote inside a double quoted string)

This is Perl 5.6.1 and Text::CSV_XS V 0.23


example code from Text::CSV_XS documentation
#!/usr/bin/perl -w use Text::CSV_XS; my $csv = Text::CSV_XS->new; my $column = ''; my $sample_input_string = '12345,Jim,,"""Smith, Jr.""",1234 W. Baker C +t., ,Ontario,CA,12345,123456789, ,,27-Apr-02,1234567 '; if ($csv->parse($sample_input_string)) { my @field = $csv->fields; my $count = 0; for $column (@field) { print ++$count, " => ", $column, "\n"; } print "\n"; } else { my $err = $csv->error_input; print "parse() failed on argument: ", $err, "\n"; }

Produces

1 => 12345 2 => Jim 3 => 4 => "Smith, Jr." 5 => 1234 W. Baker Ct. 6 => 7 => Ontario 8 => CA 9 => 12345 10 => 123456789 11 => 12 => 13 => 27-Apr-02 14 => 1234567


grep
XP matters not. Look at me. Judge me by my XP, do you?

In reply to Re: Problems With Parsing CSV File by grep
in thread Problems With Parsing CSV File by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.