Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2016-09-26 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (483 votes). Check out past polls.