Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Answer: How do I retrieve specific column values from a table of records?

( #16966=categorized answer: print w/ replies, xml ) Need Help??

Q&A > regular expressions > How do I retrieve specific column values from a table of records? contributed by le

It'd be easy if your file had a unique data seperator, like ";" or maybe "|". Then you could split() the rows on that seperator.
open (FILE, "data.txt") or die $!; while(<FILE>) { @array = split(/;/); print $array[1], $array[2]; } close(FILE);
Looks like the original data was tab-separated. split("\t") would work there. -- Ed.

Comment on Answer: How do I retrieve specific column values from a table of records?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2014-12-26 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls