I have a collection of one thousand HTML files I need to clean up for printing. I need to delete all the tags inside the <body></body> area except for one, <div.pg>. The excess are navigation links which make the printouts messy and use up paper. The contents of the tags are not the same, so I can't find and replace the code excerpt, but the tags are the same insofar as there are three <table> tags to be deleted, each with specific class. Is there any batch processing technique or software to do this job? I'm using Windows
|
|
|||||||||||||
|
An easy solution for suppressing sections when printing is to use a CSS stylesheet Add something like this to the
Note the If your HTML is all formatted in a similar way, you might do this for thousands of html files in a single command with a simplistic pattern matching edit
In print.css, set display:none for elements (e.g. whole divs) you don't want printed. For example
Update: If your thousand html files are already using a common CSS stylesheet file, the solution is even easier, no need to change or add anything in the html files, just add a section to the existing stylesheet to handle printing. For example:
|
|||||||||
|