perl, using parse_line to delimit by comma, but keep the double-quotes
Posted on 2010-08-19
I use parse_line to split a string based on comma (I don't have CSV library and do not want to install it), but I want to keep the double quote.
my $mystring = "one, two, \"three\", four";
my $delim_char = ",";
my $delim_string = "\\s*$delim_char\\s*";
my @fields = &parse_line($delim_char,0,$mystring);