Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making 2 column data filr

Status
Not open for further replies.

ovince

Programmer
Feb 27, 2007
55
FR
hi

I have 1 file with this content

f1
g1
f2
g2
...
f10
g10

and I would like to make a file from it with this content

f1 g1
f2 g2
....
f10 g10

How to do it in easy way?

thanks
oliver

P.S.
I remember that I read somewhere that this is easily done with cat command. Something like

cat -2 fileName

but I can not find exactly how. Could somebody refresh my memory?

 
hi,
for example you can do something as:
cat inputfile.txt | paste - - >> outputfile.txt

 
thanks for reply

what if I wanna make 20 column data? do I write like

paste -d ' ' - - - - - - - - - - - - - - - - - - - - - ... FILENAME > NEWFILE
 
I ask this because I remember in cat the 'column number' can be given by number
 
found it


cat fileName | -n 20


will di the job
 
pr -a -20 -t -s' ' fileName > newFile

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top