Re: sed on html pages
Joel Hammer <[email protected]>
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <1393710731.6098.1.camel@Mint15> |
Not sure I understand all you want to do, but, to insert a line break, this works: sed s/target/\n &/ On Sat, 2014-03-01 at 18:36 +0100, Silvio Siefke wrote: > > Hello, > > i use static website generator and so i clean with tidy the page. But > tidy make some mistakes and i think with sed is the way easy to fix > it. > > The empty lines i delete with sed -i '/^$/d' index.html, the div i > delete > with sed -i 's|<[/]\?div[^>]*>||g' index.html. But i found not a way i > can > break line and insert 4 steps of whitespace. > > Before: > > <title>Silvio Siefke | Blog</title><!--[if lt IE 9]> > <script src="/static/js/html5.js" type="text/javascript"></script> > <![endif]--> > <link href="/static/css/style.css" rel="stylesheet" type="text/css"> > > After: > > <title>Silvio Siefke | Blog</title> > > <!--[if lt IE 9]> > <script src="/static/js/html5.js" type="text/javascript"></script> > <![endif]--> > > <link href="/static/css/style.css" rel="stylesheet" type="text/css"> > > How can i relize? > > Can i combined all step, delete empty line, delete div, id="ext", > id="vid" > and this break line? > > Thank you for help & Nice Day > Silvio > > > >