I have a file called bt.B.1.log that looks like this:
.
.
.
Time in seconds = 260.37
.
.
.
Time in seconds = 260.04
.
.
.
etc. for 40 time records in seconds (dots represent useless strings). I have to extract this data from the file and calculate / print the average value of the .dat file (t1avg.dat) without using intermediate files. I was able to do this with intermediate files:
awk '/Time in seconds/ {print $5}' bt.B.1.log > t1.dat
awk '{sum+=$0} END {print sum/NR}' t1.dat > t1avg.dat
, , - , awk , awk , ( bt.B.1.log) t1avg.dat( t1.dat). , :
awk '{sum+=/Time in seconds/$5; print sum/NR}' bt.B.1.log
?