Re: Remove text between two 'tags'
- From: "Dave (from the UK)" <see-my-signature@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 03 Jul 2006 00:27:40 +0100
Chris F.A. Johnson wrote:
To remove all instances:
sed '/<div class="handheld">/,/<\/div>/d'
And, if there are nested <div> tags:
which there are, although I could possibly change that.
awk '/<div class="handheld">/ { x = 1; next }
/<div / && x > 0 { ++x }
/<\/div>/ && x > 0 { --x; next }
x == 0 { print }'
cheers.
If you are willing to change them by hand, why not get rid of them
at the same time?
Since I will make changes to the files.
I don't mind hacking it once to make it easier to edit automatically, but I don't want to make changes that will require me to edit it manually if I change the content - if that makes any sence!!
--
Dave K MCSE.
MCSE = Minefield Consultant and Solitaire Expert.
Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Hitting reply will work
for a couple of months only. Later set it manually.
http://witm.sourceforge.net/ (Web based Mathematica front end)
.
- References:
- Remove text between two 'tags'
- From: Dave (from the UK)
- Re: Remove text between two 'tags'
- From: Chris F.A. Johnson
- Re: Remove text between two 'tags'
- From: Chris F.A. Johnson
- Remove text between two 'tags'
- Prev by Date: Top 10 subjects comp.unix.questions
- Next by Date: how to send mails on directory/file access
- Previous by thread: Re: Remove text between two 'tags'
- Next by thread: Top 10 posters comp.unix.questions
- Index(es):
Relevant Pages
|
|