shell script to print selected lines of files side by side in output file.
I want the selected lines of file to be print in output file side by side separated by space. Here what I have did so far,
for file in SAC* do awk 'FNR==2 {print $4}' $file >>exp awk 'FNR==3 {print $4}' $file >>exp awk 'FNR==4 {print $4}' $file >>exp awk 'FNR==5 {print $4}' $file >>exp awk 'FNR==7 {print $4}' $file >>exp awk 'FNR==8 {print $4}' $file >>exp awk 'FNR==24 {print $0}' $file >>exp done My output is XV AMPY BHZ 2012-08-15T08:00:00 2013-12-31T23:59:59 I want output should be XV AMPY BHZ 2012-08-15T08:00:00 2013-12-31T23:59:59 |
Greetings.
* Note that this section is only for introductions. * |
Quote:
http://www.linuxquestions.org/questi...pt-4175609000/ ...where you were told to use CODE tags. And I'd recommend you do a quick Google search for using sed to join all lines together, or re-write your script to assign each awk to its own variable, and print them all at once, instead of appending everything to one line. |
Hi 1QAZ2WSX and welcome to LQ! :)
|
All times are GMT -5. The time now is 06:51 PM. |