Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: searching in large file

by Anonymous Monk
on Jan 06, 2018 at 02:52 UTC ( [id://1206793]=note: print w/replies, xml ) Need Help??


in reply to searching in large file

Hi,

Loading the 114 lines into a hash,then checking whether the lines in the 300k file are present in the hash will get you started.

J.C.

Replies are listed 'Best First'.
Re^2: searching in large file
by Laurent_R (Canon) on Jan 06, 2018 at 10:13 UTC
    What you suggest means that you are trying to figure out whether the lines of file 2 are in file 1. Although it is not entirely clear, the OP apparently was trying to know whether the lines of file 1 are in file 2. So, the other way around.

    So it's probably the second file that should be loaded into a hash (which is not a problem despite the second file being significantly larger, as it is not that large), and then one should lookup each line of file 1 in the hash.

    Update: actually, it is really not clear in which way the OP wants to search: at one point, it says one way, and at another point, it seems to say the other way around.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-16 05:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found