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

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 Ed Morton
On Aug 22, 1:11 pm, 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. Why? > Example > Input :  This is my book. It is too  thick to read. The author gets

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 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 Kalisz

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 solutio

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 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 > li

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: This_is_my_book