On Aug 12, Jerry Preston said:

>I am trying to breakdown this line:
>
>"q4171","(08/11/03 23:30:48)",""
>
>with  ( @data ) = split /[,|\"]/;#"

Either use the Text::CSV module from CPAN (or perhaps Text::CSV_XS), or
else use a regex like the following:

  @fields = $str =~ m{ " [^"]* " | [^,]+ }xg;

If you also want to strip quotes, you can do:

  @fields = map { s/^"// and s/"$// } $str =~ m{ ... }xg;

(Just fill the regex in.)

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to