from linux: cut -f1,5- -d" " file |grep -v "^0" | sort -n > to_file; <======this line: how to achieve this in perl? will below work, in perl? if ( ! -s $sourcedir/somefile ){
open(tmpFH,"<","file2"); @tmpAR = <tmpFH>; close(tmpFH); push(@tmpAR2,$tmpAR[0],$tmpAR[5..]); #select on columns 1 and 5 onwards from the original file my @tmpAR3 = grep {!^[0 ]} @tmpAR2; #omit line with 0 in the beginning @tmpAR3 = sort(@tmpAR3); # sort on the first column } we can then print tmpAR3 to a file. plz. advice. thx.