pattern matching question

From: John McCormick (tarrou24_at_yahoo.com)
Date: 12/23/04


Date: Thu, 23 Dec 2004 10:39:12 -0800 (PST)
To: beginners@perl.org

i'm trying to figure out how to split a file delimited
by commas and newlines.
@data = split (/\n|\,/, <infile>)
the only problem is that some of the data fields are
strings enclosed in double quotes, and within some of
those double quotes are more commas. that's too
tricky for me. how do i do that?
thanks!
court

                
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
 



Relevant Pages

  • Re: pattern matching question
    ... > by commas and newlines. ... > the only problem is that some of the data fields are ... > those double quotes are more commas. ...
    (perl.beginners)
  • Re: pattern matching question
    ... > by commas and newlines. ... > the only problem is that some of the data fields are ... > those double quotes are more commas. ...
    (perl.beginners)
  • Re: How do I include quotation marks in a TOC field code?
    ... As for the commas inside/outside the quotes, ... >>> you use italics, ... >>> Microsoft MVP ...
    (microsoft.public.word.docmanagement)
  • Re: Large text file to a CSV file...
    ... spaces if all text fields are not qualified with quotes. ... lines and replace the embedded quotes and commas. ... Open FileNameOut For Output As #intOutputHandle ...
    (microsoft.public.access.externaldata)
  • Re: Large text file to a CSV file...
    ... spaces if all text fields are not qualified with quotes. ... lines and replace the embedded quotes and commas. ... Open FileNameOut For Output As #intOutputHandle ...
    (microsoft.public.access.externaldata)