I'm trying to add the result of a print statement as a new column in the file t1.dat:
awk '/Time in seconds/ {print $5}' bt.B.1.log > t1.dat
awk '/Total processes/ {print $4; exit}' bt.B.1.log >> t1.dat
Contents of bt.B.1.log:
Time in seconds = 260.37
Total processes = 1
Output: (t1.dat)
260.37
1
Desired output:
260.37 1
But, for now, awk is appending it as a new line in t1.dat. How do I get it to append it as new column in an existing file (in this case, t1.dat), without using intermediate files?