in reply to Re: parsing CSV file with embedded commas (fortunately, fixed-width) - is unpack the solution?
in thread parsing CSV file with embedded commas (fortunately, fixed-width) - is unpack the solution?

Note that this will have problems (quite reasonably) dealing with the unescaped single quotes inside of single-quoted fields that amelinda's data appears to have.

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re4: parsing CSV file with embedded commas (fortunately, fixed-width) - is unpack the solution?

Replies are listed 'Best First'.
Re: (tye)Re: parsing CSV file with embedded commas (fortunately, fixed-width) - is unpack the solution?
by davorg (Chancellor) on Nov 01, 2001 at 03:32 UTC

    Hmm... well you're right that it would break on unescaped single quotes, but looking at amelinda's data I couldn't see any. Double quotes yes, but not single quotes. That's why I sugggested it.

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you don't talk about Perl club."

      Yes, no such examples were shown. However, amelinda wrote:

      In some, other records, one of the other text fields has an embedded '.
      as well says in the title (and confirmed in chatter) that the fields are fixed-width, which means that the embedded ' very likely isn't doubled (or otherwise escaped). (:

              - tye (but my friends call me "Tye")