Re: sed task

From: Alan Connor (zzzzzz_at_xxx.yyy)
Date: 02/29/04


Date: Sun, 29 Feb 2004 07:58:19 GMT

On Sun, 29 Feb 2004 01:51:07 -0500, Nick <nbdy9.nospam@hotmail.com> wrote:
>
>
> Alan Connor wrote:
>> On Sun, 29 Feb 2004 00:03:33 -0500, Nick <nbdy9.nospam@hotmail.com> wrote:
>>
>>>
>>>How to use sed do the following task:
>>>
>>>suppose I have a html file. I want to replace all the "-" with "_" in
>>>all the <title> tags?
>>>
>>>from
>>><... tag="abd-123-345" title="abd-123-345" ....>
>>>to
>>><... tag="abd-123-345" title="abd_123_345" ....>
>>
>>
>> You could try this:
>>
>> sed 's/\(title=".*\)-\(.*\)-\(.*"\)/\1_\2_\3/' inputfile > outputfile
>>
>> AC
>>
>
> Thanks, however, the number of the "-" are not fixed....

Well FIX them.

:-)

AC