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

Thank you for the replay, i edited the posted with the correct output
  • Comment on Re^4: compare two text file line by line, how to optimise

Replies are listed 'Best First'.
Re^5: compare two text file line by line, how to optimise
by poj (Abbot) on Feb 27, 2016 at 13:30 UTC

    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