The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 04-21-2009
colemar colemar is offline
Registered User
  
 

Join Date: Apr 2009
Location: Trento, Italy
Posts: 116
Can you state the requirements in natural language?

Perhaps you want to transpose a column of unknown length to a row whose elements are separated by commas, and a fixed number of additional elements are to be added at the row start.
Code:
colemar@deb:~$ cat inputfile 
one
two
three
four
five
colemar@deb:~$ echo red,blue,white,$(tr '\n' ',' < inputfile)
red,blue,white,one,two,three,four,five,