Re: Modifying strings in a file.

From: Fabrice Guerini (fabrice@BLUEMARTINI.COM)
Date: Wed Aug 28 2002 - 16:13:02 EDT


On 12:56 PM 8/28/2002, Ron Schwingel uttered:

>The below won't work because I will not always know what word2 word3 word4
>is.
>
>sed -e 's/^#Word1 Word2 Word3 Word4/Word1 Word2 Word3 Word4/' file >
>/tmp/file

Ah, why didn't you say so earlier!...

sed -e 's/^#\([^ ]* [^ ]* [^ ]* [^ ]*\)/\1/'

+===========================================================+
| Fabrice "Script It!" Guerini Blue Martini Software, Inc. |
| Senior Operations Engineer 2600 Campus Drive |
| Tel: (650) 356-7576 San Mateo, CA 94403-2522 |
| Fax: (650) 356-4001 www.bluemartini.com |
+===========================================================+



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:10 EDT