in reply to Process large text data in array
** Fastest approach tested so far **
As suggested by BrowserUk, I have done a test using the file reading method as suggested. The results absolutely encouraging. From previous reading + processing = 21sec+-. It reduced to just 15sec or less with added up more data from 300k to 400k lines of data.
my (@dat) = (); open (DATF, "<$file_name"); while( <DATF> ) { my ($line) = $_; chomp($line); my (%trec) = &line2rec($line); # just do some filtering here if ($trec{'active'}) { } # just testing to move every data line into array push (@dat, $line); } close(DATF);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Process large text data in array
by SimonPratt (Friar) on Mar 11, 2015 at 14:49 UTC | |
by BrowserUk (Patriarch) on Mar 11, 2015 at 15:17 UTC | |
by SimonPratt (Friar) on Mar 11, 2015 at 16:01 UTC | |
by BrowserUk (Patriarch) on Mar 11, 2015 at 17:24 UTC | |
by SimonPratt (Friar) on Mar 11, 2015 at 18:12 UTC |