sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ?

2009-08-22 Thread bolega
sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ? I really prefer a sed one liner. Example Input : This is my book. It is too thick to read. The author gets little royalty but the publisher makes a lot. Output:

Re: sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ?

2009-08-22 Thread w_a_x_man
On Aug 22, 1:11 pm, bolega gnuist...@gmail.com wrote: sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ? I really prefer a sed one liner. Example Input :  This is my book. It is too  thick to read. The author gets little royalty but the

Re: sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ?

2009-08-22 Thread Tim Chase
bolega wrote: sed/awk/perl: Better to post in the sed or perl mailing lists rather than a Python list. I saw an awk solution flew by. How to replace all spaces each with an underscore that occur before a specific string ? I really prefer a sed one liner. Here's a one-liner sed solution:

Re: sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ?

2009-08-22 Thread Jan Kaliszewski
22-08-2009 o 20:11:32 bolega gnuist...@gmail.com wrote: sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ? $ rm -rf /home/bolega ; python -c 'for i in xrange(1000): print I will never crosspost senselessly.' ;~] -- Jan Kaliszewski (zuo)

Re: sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ?

2009-08-22 Thread Ed Morton
On Aug 22, 1:11 pm, bolega gnuist...@gmail.com wrote: sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ? I really prefer a sed one liner. Why? Example Input :  This is my book. It is too  thick to read. The author gets little royalty

Re: sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ?

2009-08-22 Thread John W. Krahn
bolega wrote: sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ? I really prefer a sed one liner. Example Input : This is my book. It is too thick to read. The author gets little royalty but the publisher makes a lot. Output:

Re: sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ?

2009-08-22 Thread MRAB
John W. Krahn wrote: bolega wrote: sed/awk/perl: How to replace all spaces each with an underscore that occur before a specific string ? I really prefer a sed one liner. Example Input : This is my book. It is too thick to read. The author gets little royalty but the publisher makes a lot.