Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Parsing a string

by johna (Monk)
on Feb 22, 2011 at 18:38 UTC ( [id://889647]=note: print w/replies, xml ) Need Help??


in reply to Parsing a string

I think Text::ParseWords (core module) should work as well:
#!/usr/bin/perl use strict; use warnings; use Text::ParseWords; my $s = q[ci,14938340,2,"Monday, February 21, 2011 19:58:06 UTC",34.69 +53,-118.5350,2.2,17.40, 9,"Southern California"]; print join "\n", parse_line(",", 1, $s); print "\n";
Outputs:
ci 14938340 2 "Monday, February 21, 2011 19:58:06 UTC" 34.6953 -118.5350 2.2 17.40 9 "Southern California"
-John

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://889647]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-24 19:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found