i have a few vi commands that i'd like converting to something that can run on a command line, something like sed'd be good ...
i've got an html doc that needs cleaning up ... someone elses i must say, i hand code mine, but he's got about 50 docs, and i was just thinking if there was an easier way than 'vi'ing each doc and typing in the following commands.
hope that gives you the idea ...
Thanks
i've got an html doc that needs cleaning up ... someone elses i must say, i hand code mine, but he's got about 50 docs, and i was just thinking if there was an easier way than 'vi'ing each doc and typing in the following commands.
Code:
vi <doc>.htm (yuck, not even html)
:g/></s//>^M</g (yes that is ctrl-v, ctrl-m)
:g/<[^>]*$/j (repeated lots of times ... j joins lines and puts a space before each join, although i don't need the space)
:g/<\/P[^>]*>/s///g
:g/ *>/s//>/g
hope that gives you the idea ...
Thanks