How to convert rows to columns in unix

前端 未结 5 1056
离开以前
离开以前 2021-01-03 12:50

I want my Unix file output, which has each value output on a new line, to be converted into grouped rows as shown below.

Say my output file in Unix looks like this:

5条回答
  •  不知归路
    2021-01-03 13:11

    If you are looking for a shell script, you can do this as the number of lines to be printed in the output seems to have to fixed length:

    while read line1; do
      read line2
      read line3
      read line4
      echo $line1 $line2 $line3 $line4 >>output
    done 

提交回复
热议问题