in reply to Performing Mathematical Operation on Specific Column of text File
Use single-quotes for Linux. Format, and redirect output as desired.>perl -ane "next unless $F[0]=~/^ZJ/;$count++;$val+=$F[8]}{printf qq|% +d values; mean=%.4f\n|,$count,$val/$count" source.file.name.txt #OUTPUT: 6 values; mean=-1.1958
"You're only given one little spark of madness. You mustn't lose it." - Robin Williams
|
|---|