0

I have a spreadsheet has one column as the following:

            column A    
1                  a
2                  b
3                  c
4                  d
5                  e

I want to save this spreadsheet and transpose the column by row as the following:

ID   column A column B column C column D column E
1           a        b        c        d        e

How can I do that?

terdon
  • 242,166

1 Answers1

0

I suspect that you’re not telling us all your requirements.  Based on what you are saying (asking), either of the following should work:

  1. echo $(cat existing_file) > newfile

    $(…) puts the output of the command inside the parentheses on the command line, where the shell converts newlines into spaces.

  2. { tr '\n' ' ' < existing_file; echo;} > newfile

    The tr converts every newline in the existing file (including the very last one) to a space; then add a newline.