Re: Sed or Awk Question

2003-01-14 Thread Mike Dresser
On Tue, 14 Jan 2003, Colin Watson wrote: > > cat testfile | xargs > > You win today's "useless use of cat" award. :) ('xargs < testfile') YAaay I'll put this one up on the mantle with the others! Mike -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject o

Re: Sed or Awk Question

2003-01-14 Thread Colin Watson
On Tue, Jan 14, 2003 at 03:47:34PM -0500, Mike Dresser wrote: > On 14 Jan 2003, Jody Grafals wrote: > > Dose anyone know how to replace a line break with a space using sed or > > awk? > > cat testfile | xargs You win today's "useless use of cat" award. :) ('xargs < testfile') Cheers, -- Colin

Re: Sed or Awk Question

2003-01-14 Thread Mike Dresser
On 14 Jan 2003, Jody Grafals wrote: > Dose anyone know how to replace a line break with a space using sed or > awk? cat testfile | xargs -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Re: Sed or Awk Question

2003-01-14 Thread Jan Trippler
On Die, 14 Jan 2003 at 13:42 (-0500), Jody Grafals wrote: > > Dose anyone know how to replace a line break with a space using sed or > awk? > > for example > > cat > dog > goat > duck > > would become > > cat dog goat duck You don't need to use sed or awk: jan@k500:~/tmp> x=`cat animal

Re: Sed or Awk Question

2003-01-14 Thread Bruno Diniz de Paula
Using awk: cat file | awk '{if(NR==1){printf "%s", $0;}else{printf " %s", $0;}}' Cheers, Bruno. On Tue, 2003-01-14 at 13:42, Jody Grafals wrote: > Dose anyone know how to replace a line break with a space using sed or > awk? > > for example > > cat > dog > goat > duck > > would become >

Re: Sed or Awk Question

2003-01-14 Thread Frank Gevaerts
On Tue, Jan 14, 2003 at 01:42:43PM -0500, Jody Grafals wrote: > > Dose anyone know how to replace a line break with a space using sed or > awk? I usually do that with tr: cat file | tr '\012' ' ' Frank > > for example > > cat > dog > goat > duck > > would become > > cat dog goat duck

Re: Sed or Awk Question

2003-01-14 Thread Craig Dickson
Jody Grafals wrote: > Dose anyone know how to replace a line break with a space using sed or > awk? > > for example > > cat > dog > goat > duck > > would become > > cat dog goat duck This should do, and it's simpler than either sed or awk: tr '\n' ' ' Craig msg24097/pgp0.pg

Re: Sed or Awk Question

2003-01-14 Thread Gregory Seidman
Jody Grafals sez: } Dose anyone know how to replace a line break with a space using sed or } awk? [...] Wrong tool. Use tr. tr '\012' ' ' } Thanks in advanced } Jody --Greg -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]