|Keep It Simple, Stupid|
Extacting lines where one column matches a name from a list of namesby mr_clean (Initiate)
|on Sep 13, 2019 at 01:07 UTC||Need Help??|
mr_clean has asked for the wisdom of the Perl Monks concerning the following question:
Hello, wise monks.
I have some tab delimited data:
name1 \t data \t moredata \t evenmoredata \t
And a list of names which are interesting;
name1 name2 name3 name4
I have been using awk to extract rows from the tab delimited file where column 0 matches my name, and looping through my list of names in order to extract all matching rows. But as my data grows, this task gets very time consuming (6 hours for 200 mb worth of data; and I want to analyse files that are 10 gb!)
So I would like to user perl (I have no perl experience, previously worked in bash).
Convert each entry in the data file to a key (the name column) and corresponding hashes (all the other data in each column).
But I have no idea where to start.