Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^5: compare two text file line by line, how to optimise

by poj (Abbot)
on Feb 27, 2016 at 13:30 UTC ( [id://1156313]=note: print w/replies, xml ) Need Help??


in reply to Re^4: compare two text file line by line, how to optimise
in thread compare two text file line by line, how to optimise

So, taking the first line of file 2

chirac presidential migration

compare this with each line of file 1 in turn

chirac prime paris
chirac prime jacques
chirac prime president 
chirac paris france
chirac paris french

and calculate how many words match. Output the file 1 line if the count is greater than a minimum value. Repeat for each line in file 2.

For this example, the number of words matching is only 1 ("chirac") in each case so if the minimum is 2 then none of the above lines be would output. Is that the logic ?

poj

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-03-29 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found