Re: Search for word delete next line to EOF



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.

.



Relevant Pages

  • Re: whats with mf?
    ... control-d (EOF) works in unix. ... but it leaves a lot of junk laying around. ... it should provide the ability to clean up critical data before the ... But to suggest that mf wants to restructure the conventions of unix ...
    (comp.text.tex)
  • Re: Search for word delete next line to EOF
    ... I have several html files that have junk I need to clean up. ... I haven't used Unix in a long time so please go easy on me ...
    (comp.unix.shell)
  • Re: Search for word delete next line to EOF
    ... I have several html files that have junk I need to clean up. ... I haven't used Unix in a long time so please go easy on me ...
    (comp.unix.shell)
  • Search for word delete next line to EOF
    ... I have several html files that have junk I need to clean up. ... I haven't used Unix in a long time so please go easy on me ...
    (comp.unix.shell)
  • Re: Hard Disk Activity
    ... (The whole PCHealth / Windows File Protection ... junk services culled. ... actually accessing the disk, though. ... If you want to clean up and disable some of the ...
    (microsoft.public.vb.general.discussion)