Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I am trying to read 5GB(file size) text file and search some content in that file. But I got "Out of memory" error.
Could you please provide your suggestion.
open FIN, $inputFile or die $!; while (my $lines = <FIN>) { chomp $sword; unless ($lines =~ /$sword/i) { print "$sword\n"; } } close FIN;
thanks,
PerlUser.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Out of memory error while Reading 5GB text file
by varian (Chaplain) on Apr 04, 2007 at 06:59 UTC | |
|
Re: Out of memory error while Reading 5GB text file
by idle (Friar) on Apr 04, 2007 at 06:45 UTC | |
|
Re: Out of memory error while Reading 5GB text file
by prasadbabu (Prior) on Apr 04, 2007 at 06:34 UTC | |
|
Re: Out of memory error while Reading 5GB text file
by robot_tourist (Hermit) on Apr 04, 2007 at 14:04 UTC | |
|
Re: Out of memory error while Reading 5GB text file
by jfroebe (Parson) on Apr 04, 2007 at 13:41 UTC | |
by ikegami (Patriarch) on Apr 04, 2007 at 15:57 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |