Microsoft
Software
Hardware
Network
Question : perl, using parse_line to delimit by comma, but keep the double-quotes
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.
use Text::ParseWords;
my $mystring = "one, two, \"three\", four";
my $delim_char = ",";
my $delim_string = "\\s*$delim_char\\s*";
my @fields = &parse_line($delim_char,0,
$mystring)
;
print join("\n",@fields),"\n";
Answer : perl, using parse_line to delimit by comma, but keep the double-quotes
Put a 1 for the $keep variable (2nd parameter)
man Text::ParseWords explains the syntax of the below
my @fields = &parse_line($delim_char,1,
$mystring)
;
Random Solutions
Running RMI on Tomcat Servlet - How do I set up RMISecurityManager?
why avoid system tables?
Email sent to Tiscali email addresses bouncing with No PTR record error
Why don't Lotus Notes document links work when sent to MS Outlook emails.
Firebox X500 - Where to start....
Link to PDF files from DVD Menu
SBS 2008 strange issue
Fading in/out a popup Window in Flex 4.0
Returning 0 from a template member function when instantiated with aggregate types
Server 2008 NLB problem