Hi Chas, It works...but the problem I have is that some of the records are totally lost. And also the output file keeps on writing multiple times and grows into a huge size. almost 10 times, it keeps on growing until I kill the script.
I checked few of the records which have calculated properly and giving me the desired result, while the others are totally lost in the output. Check my code after closing the file. Is it the culprit? close $IN_FILE ; open (my $OUT_FILE,">>","$write_path/$file.out") or die $!; while (my($key, $value) = each %hash) { print $OUT_FILE $value; } close $OUT_FILE ; } } closedir $dh ; } Thanks..