in reply to compare two text files
If i understood your question correctly this should work for you. This can be done still efficiently.
open (GEN, "<general.txt") || die ("cannot open general.txt"); open (SEA, "<search.txt") || die ("cannot open search.txt"); undef $/; $gen = <GEN>; $sea = <SEA>; @gen = split /\n/, $gen; @sea = split /\n/, $sea; for $a (@gen) { @result = grep/^\Q$a\E$/, @sea; push (@final , @result); } print "Search string that matches against general data:\t@final";
Prasad
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: compare two text files
by juergenkemeter (Novice) on Jul 14, 2005 at 05:19 UTC | |
by prasadbabu (Prior) on Jul 14, 2005 at 05:29 UTC | |
by juergenkemeter (Novice) on Jul 14, 2005 at 05:59 UTC | |
by prasadbabu (Prior) on Jul 14, 2005 at 06:06 UTC | |
by Anonymous Monk on Aug 22, 2007 at 13:18 UTC |
In Section
Seekers of Perl Wisdom