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!

alternative to paste 1

Status
Not open for further replies.

dodge20

MIS
Jan 15, 2003
1,048
US
Is there a sed alternative to paste? I am using
paste -s -d" " test2.txt > test2.tmp

to replace returns with spaces

but I read in the man pages that there is a limit of 511 characters. There might be instances where the output is longer than 511 characters.

Thanks

Dodge20
 
Hi

But while your asked for [tt]sed[/tt]
Code:
sed -n '1{h;n};H;${g;y/\n/ /;p}' test2.txt > test2.tmp

[gray]# or abit faster[/gray]

sed -n 'H;${g;s/\n//;y/\n/ /;p}' test2.txt > test2.tmp

Feherke.
 
Both those sed commands give me a command garbled error. Both the tr and awk commands work, so I think I can use those.

Thanks

Dodge20
 
Hi

Oops. I forgot to add the disclaimer :

Tested with GNU [tt]sed[/tt].

Sadly many of my [tt]sed[/tt] solutions are based on GNU [tt]sed[/tt]'s enhanced versatility.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top