Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 meditating upon the Monastery: (4)
As of 2015-07-03 00:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (47 votes), past polls