excel - Shell script output file to be saved in MSExcel -


i have shell script output file

aa bb cc dd eee fff 

and want save in excel sheet 2 columns.

first  second   aa      bb   cc      dd  eee      fff 

online browsing found

awk 'begin{ ofs=" "; print "first|second"}; nr > 1{print "$0", "$1"}' input.txt > output.xls 

but not output file.

set output field separator comma, , should ok:

awk '     begin {ofs=","; print "first", "second"}     {print $1, $2} ' input.txt > output.xls 

with awk, $0 complete record , $1 first field.
also, don't need skip first line of input.


Comments