coldy has asked for the wisdom of the Perl Monks concerning the following question:
but the results must be in the same order as they appear in list.txt. I have triedfgrep -w -f list.txt largefile.txt
but this does not work... the file $list is a single field and the file $large has several fields but is matched to $list by the first field. Any advice would be appreciated. Thanks..my @list = <$list>; my @large = <$large>; foreach my $test (@list){ print grep (/^$test/,@large); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: emulate "fgrep -f file" with results ordered by "file"
by toolic (Bishop) on Mar 15, 2011 at 02:10 UTC | |
by coldy (Scribe) on Mar 15, 2011 at 02:32 UTC | |
by Eliya (Vicar) on Mar 15, 2011 at 02:59 UTC | |
by coldy (Scribe) on Mar 15, 2011 at 03:19 UTC |