Re: sed on html pages
Petr Lázňovský <[email protected]>
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <[email protected]> |
Do not know if this is related to your discussion, but have you ever seen Xidel? http://videlibri.sourceforge.net/xidel.html > Regardless of all the discussion (and silliness) on the link you provided - You're right sed is not well suited to "whip HTML pages into shape". I doubt any generic tool (sed, awk, perl, etc.) is up to that task, because *** HTML is complex, *** HTML allows many variants, *** much HTML code is sloppy, *** you run into multi-line processing challenges. So it is good to warn about the potential for "steadily degrading process". Keep some backups, in case there are unexpected "side effects". > However, I think sed is fine for editing HTML (or any text file), as long as the task is somewhat limited and clearly defined, and the sed syntax is right. sed is just a tool, does exactly what you tell it. > Another option for cleaning up HTML files is vi / vim, which will let you speed things up a lot, but still confirm the changes and maybe avoid some "gotchas", but can get pretty tedious with the n.n.n.n. routine. There is a lot of overlap between sed and vi - same heritage, shared syntax, big learning curve, great power. > I can also suggest HTP http://htp.sourceforge.net/ "HTML pre-processor" for helping maintain HTML files. I used to use (abuse?) cpp for a lot to pre-process HTML, but HTP is a lot better, because specifically designed for the task. > Daniel > In case helpful - For those using the yahoo groups interface, the default is to reply to an individual, not the group (I messed up on this). You have to click on the left hand side of the formatting bar (two "hats") to expose the "To:" line so you can change the recipient to the entire group. > >