hi! all,
in a directory nearly 10 zipped file are available.
totally the size of the all files is nearly 15GB.
i have to retrive the line which dont have the text "ORA" from each file and i have to write this data to a another big file.
i got it but it is taking the time of nearly 5 minutes to complete the process.But i have to process 7 directories at a time..so totally it is taking so much time..
i wrote the code as..
[CODE=perl] !#use/bin/perl
@filenames=</home/dir/*.gz>;
open(OUT ,">bigfile") ;
foreach $file(@filename s)
{
open(IN,"gzcat $file|");
while($line=<IN >)
{
next if($line=~/^ORA | ^$/);
print OUT $line;
}
close IN;
}# end for
close OUT;
[/CODE]
this is only for one directory..like this seven directories r there.
if any one knows better way to do this..in order to reduce the time comlexity plz help me as i m new to perl.
thank & regards,
Manogna.
in a directory nearly 10 zipped file are available.
totally the size of the all files is nearly 15GB.
i have to retrive the line which dont have the text "ORA" from each file and i have to write this data to a another big file.
i got it but it is taking the time of nearly 5 minutes to complete the process.But i have to process 7 directories at a time..so totally it is taking so much time..
i wrote the code as..
[CODE=perl] !#use/bin/perl
@filenames=</home/dir/*.gz>;
open(OUT ,">bigfile") ;
foreach $file(@filename s)
{
open(IN,"gzcat $file|");
while($line=<IN >)
{
next if($line=~/^ORA | ^$/);
print OUT $line;
}
close IN;
}# end for
close OUT;
[/CODE]
this is only for one directory..like this seven directories r there.
if any one knows better way to do this..in order to reduce the time comlexity plz help me as i m new to perl.
thank & regards,
Manogna.
Comment