Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^5: Filtering Output from two files

by AnomalousMonk (Archbishop)
on Feb 04, 2018 at 16:18 UTC ( [id://1208431]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Filtering Output from two files
in thread Filtering Output from two files

If your File1 has 700,000 lines, rest assured that a hash can easily accommodate this number of lines or even many more — if the lines are sufficiently short, i.e., not thousands of characters!

One pitfall to avoid: When you read each line from your File1, it will have some kind of line-end delimiter, typically a newline. This will have to be removed (see chomp) before adding it to the lookup hash because a COA213345 field split from the beginning of a line in File2 will have no such delimiter. (Looking up a key in a hash (see exists) is essentially an  eq string exact equality operation.)

Perhaps take a look at some of the articles in the Input and Output section of the Monastery's Tutorials.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1208431]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-25 08:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found