Re: sed task
From: Alan Connor (zzzzzz_at_xxx.yyy)
Date: 02/29/04
- Next message: Nick: "Re: sed task"
- Previous message: Nick: "sed task"
- In reply to: Nick: "sed task"
- Next in thread: Nick: "Re: sed task"
- Reply: Nick: "Re: sed task"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 29 Feb 2004 06:05:05 GMT
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
-- ed(1) Check out the original tutorials by Brian W. Kernighan at the Ed Home Page http://tinyurl.com/2aa6g
- Next message: Nick: "Re: sed task"
- Previous message: Nick: "sed task"
- In reply to: Nick: "sed task"
- Next in thread: Nick: "Re: sed task"
- Reply: Nick: "Re: sed task"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]