I have a huge file, there are 47,286,116 lines. I am search a line and repalce 
this line with another string. I know this line is between 20,000,000th to 
30,000,000th lines. Which way is more fast and safe:
 
method 1:
use Tie::FILE;
tie my @array, 'Tie""File', "aa.txt", memory =>100_000_000 or die;
for(my $i = 20000000; $i < 30000000; $i ++){
.......
}
untie @array;
 
method 2;
open(AA, "aa.txt");
while(<AA>){
...
}
close(AA);
 
Thanks
 
Org.
 
 
 
 
 
_________________________________________________________________
It's simple! Sell your car for just $40 at CarPoint.com.au
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT

Reply via email to