|
|
|
|
|
|
| Author |
Message |
Ed Morton *nix forums Guru
Joined: 20 Feb 2005
Posts: 1073
|
Posted: Fri Feb 11, 2005 2:56 pm Post subject:
Re: How to replace text with Tags?
|
|
|
btna wrote:
| Quote: | Hi all,
I need to replace text within HTML tags with a space or a tab. How can
I use sed or any other utility to do this?
My file contains something like:
Text to be replaced here> some text < text to be repalced here
The ultimate goal is to have it like this:
some text
Thanks in advance for any ideas,
BTNA
|
Either of these would do it:
gawk 'BEGIN{FS="<[^>]*>";OFS="< >"}{$1=$1}1'
gawk '{gsub("<[^>]*>","< >")}1'
sed 's/<[^>]*>/< >/g'
Regards,
Ed. |
|
| Back to top |
|
 |
Bern *nix forums beginner
Joined: 08 Mar 2005
Posts: 36
|
Posted: Fri Feb 11, 2005 2:39 pm Post subject:
Re: How to replace text with Tags?
|
|
|
Try this
sed 's/<.*\(>.*<\).*>/< \1 >/' file |
|
| Back to top |
|
 |
btna *nix forums beginner
Joined: 18 Jul 2005
Posts: 13
|
Posted: Fri Feb 11, 2005 2:24 pm Post subject:
How to replace text with Tags?
|
|
|
Hi all,
I need to replace text within HTML tags with a space or a tab. How can
I use sed or any other utility to do this?
My file contains something like:
<Text to be replaced here> some text < text to be repalced here>
The ultimate goal is to have it like this:
< > some text < >
Thanks in advance for any ideas,
BTNA |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Jan 08, 2009 9:58 pm | All times are GMT
|
|
Fish Tank Help | France Hotels | Discount Magazine Subscriptions | Loans | Latest Credit Cards
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|