I have a huge tab-separated file formatted like this
X column1 column2 column3 row1 0 1 2 row2 3 4 5 row3 6 7 8 row4 9 10 11
I would like t
Not very elegant, but this "single-line" command solves the problem quickly:
cols=4; for((i=1;i<=$cols;i++)); do \ awk '{print $'$i'}' input | tr '\n' ' '; echo; \ done
Here cols is the number of columns, where you can replace 4 by head -n 1 input | wc -w.
head -n 1 input | wc -w