tags:

views:

30

answers:

2

Is there an easy way or an html editor that can find all like-phases and the delete them from the file? I have a html with over 15000 lines, and would like to remove every div element... instead of finding them all and deleting them separately, is there a way to highlight all of them in one and delete them all?

None of these div's have any class or style attributes to worry about so i just need to search for the div tag...

A: 

Any good text editor that supports regular expression based find and replace should be able to help you with this. Especially if the HTML is well structured and uncomplicated as you describe.

I'd recommend Emacs or Vim but I'm sure you'll have your favorites.

Manoj Govindan
A: 
$ sed -i -re 's/<div>(?:[^<]*)</div>//' [files]
Delan Azabani