in reply to Re: Out of Memory - Line of TXT too large
in thread Out of Memory - Line of TXT too large
Sorry I'm newish to Perl so I apologize if I'm asking simple questions.
So all I would need to do is add $/ = 30; to my code and it should only read in the first 30 characters? So something like:
open (LOG, $file); open (OUT, ">", $outf); $/ = 50; my $header = <LOG>; print OUT $header; while (<LOG>) { print OUT $_ if ($_ =~ /^\{\|\d{4}-\d{2}-\d{2}_\d{2}.\d{2}.\d{2}\| +LOGIN/); } close LOG; close OUT;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Out of Memory - Line of TXT too large
by Corion (Patriarch) on Jan 02, 2014 at 13:09 UTC | |
by MajinMalak (Initiate) on Jan 02, 2014 at 13:57 UTC | |
by roboticus (Chancellor) on Jan 02, 2014 at 14:04 UTC | |
by Corion (Patriarch) on Jan 02, 2014 at 14:00 UTC | |
by Anonymous Monk on Jan 02, 2014 at 15:13 UTC |