Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: parsing question

by ikegami (Patriarch)
on Dec 07, 2006 at 02:54 UTC ( [id://588247]=note: print w/replies, xml ) Need Help??


in reply to parsing question

unpack would work great here.
my $format = join '', map { "A$_" } 3, # Player number 21, # Player name 4, # G 4, # A 6, # +/- 5, # S 6, # PIM 6, # MIN 6, # MAJ 5, # 10 5, # GM 5, # GR 5, # MT 6, # PPG 6, # SHG 6, # GWG 6, # OTG 6, # UAG 6, # ENG 5; # FG while (<$fh>) { next unless /^\d+\s/; # Skip headers. my @record = unpack($format, $_); # Parse data. $record[4] =~ s/^\s+//; # Fix "+/-" formatting. $sth->execute(@record); # Add data to the database. }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-25 18:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found