Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by le (Friar)
on Jun 08, 2000 at 01:30 UTC ( #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? - Answer 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?
Jar. Jar!...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2017-04-24 01:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (433 votes). Check out past polls.