Re: Search for word delete next line to EOF
- From: "Janis" <janis_papanagnou@xxxxxxxxxxx>
- Date: 13 Oct 2006 06:54:17 -0700
Ed Morton wrote:
Steve wrote:
All,
I have several html files that have junk I need to clean up.
The junk appears after the first appearance "</BODY></HTML>"
The next line is blank
After that is all junk which also ends with </BODY></HTML>
How do I find first </BODY></HTML> and delete everything after that?
I haven't used Unix in a long time so please go easy on me
Thanks
Steve
awk '/<\/BODY><\/HTML>/{exit}1' file > tmp && mv tmp file
Shouldn't that be
awk '1;/<\/BODY><\/HTML>/{exit}' file > tmp && mv tmp file
Janis
Regards,
Ed.
.
- Follow-Ups:
- Re: Search for word delete next line to EOF
- From: Ed Morton
- Re: Search for word delete next line to EOF
- References:
- Search for word delete next line to EOF
- From: Steve
- Re: Search for word delete next line to EOF
- From: Ed Morton
- Search for word delete next line to EOF
- Prev by Date: Re: obtain alias name in my script
- Next by Date: Re: Replacing an instruction in all project files
- Previous by thread: Re: Search for word delete next line to EOF
- Next by thread: Re: Search for word delete next line to EOF
- Index(es):
Relevant Pages
|