in reply to Re^8: compare two text file line by line, how to optimise
in thread compare two text file line by line, how to optimise
Add a print when at least 1 of the words match if that's the output you want
pojwhile (my $line = <FIC>) { my @words = split /\s+/,lc $line; ++$uniq2{$_} for @words; $words2 += @words; ++$count2; my @match = grep $uniq1{$_}, @words; print $line if @match >= 1; # <-- add here }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: compare two text file line by line, how to optimise
by thespirit (Novice) on Feb 28, 2016 at 16:31 UTC | |
by poj (Abbot) on Feb 28, 2016 at 16:55 UTC | |
by thespirit (Novice) on Feb 29, 2016 at 22:45 UTC | |
by poj (Abbot) on Mar 01, 2016 at 08:23 UTC | |
by thespirit (Novice) on Mar 01, 2016 at 12:59 UTC | |
|