Linux-Change line between two awk scripts -
i have 2 awk scripts run in linux. output of each 1 in 1 line. how can separate 2 output 2 lines?
for example:
awk '{printf $1}' f.txt >> a.txt awk '{printf $3}' f.txt >> a.txt
the output of first script is:
35 56 40 28 57
and second output is:
29 48 73 26
if run them 1 after another, output become:
35 56 40 28 57 29 48 73 26
is there way result to:
35 56 40 28 57 29 48 73 26
thank you!~
although don't understand how manage spaces between fields way it, can add end
statement first script:
awk '{printf $1} end{print "\n"}'
you can single awk command:
awk -v ors=" " 'begin{argv[argc++] = argv[1]; = 1 } nr!=fnr && fnr==1 { printf "\n"; i=3 } { print $i } end { printf "\n" }' f.txt
Comments
Post a Comment