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

Now i understand

But my probelm is to compare line by line, and not only find the word in the $uniq1,so i search by combination, may be i must use a hash of array to stock the word of each line

  • Comment on Re^14: compare two text file line by line, how to optimise

Replies are listed 'Best First'.
Re^15: compare two text file line by line, how to optimise
by poj (Abbot) on Mar 01, 2016 at 13:14 UTC

      if the line1 in file 1 contain: izetbegovic slobodan milosevic someday serbian peace

      your program put these words in %uniq1 as key

      line2 in file 2 : slobodan serbian peace serbs bosnia milosevic

      you put this line in @match

      now you grep $uniq1{$_} with @match, here you don't compare the line from @match with a line from the file1, but you campare it with all the word contained in file, and what i want is to compare line by line

      may be i'm not correct!?

        the number of common word is defined by the program,because i treat different files, i compare only file that have sentences with the same lenght ( i have file that contain only 2, 3 , 4, 5 or 6 words by line) so i compare 6 by 6, or 4 by 4 words