Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 03-29-2010, 10:09 PM   #1
Solicitous
Wizard
Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.
 
Posts: 1,404
Karma: 1137946
Join Date: Aug 2009
Location: TAS, Australia
Device: Astak Pocket Pro (Black), 2 x Kindle WiFi (Graphite), iPod Touch 4G
Header/Footer removal

Hi All,

I have a few books in .HTML format, with each book having individual .HTML pages for each chapter. Now I am trying to convert these to .EPUB and remove the headers/footers and am really stuck with regex.

The header and footers look like this from the .HTML file.

Quote:
<hr>
<p class="nav">
<a href="Chapter19.html">previous</a> |
<a href="-Book Title-.html">Table of Contents</a> |
<a href="Chapter21.html">next</a></p>
<hr>
So obviously the ChapterXX.html will increment/decrement depending on the current page. Is someone able to help me construct a regex to remove those headers/footers please? (both the header and footer have identical code ie: top and bottom of the page had identical links).
Solicitous is offline   Reply With Quote
Old 03-29-2010, 11:36 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 24,768
Karma: 4369667
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
(?s)<hr>.*?<p class="nav">.*?</p>.*?<hr>
kovidgoyal is online now   Reply With Quote
Old 03-30-2010, 05:53 AM   #3
Solicitous
Wizard
Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.Solicitous ought to be getting tired of karma fortunes by now.
 
Posts: 1,404
Karma: 1137946
Join Date: Aug 2009
Location: TAS, Australia
Device: Astak Pocket Pro (Black), 2 x Kindle WiFi (Graphite), iPod Touch 4G
Thanks for that, worked a treat. Muchly appreciated.
Solicitous is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
footer removal help icy Calibre 7 08-27-2010 01:21 PM
Removing header and footer radicalnomad Calibre 2 08-26-2010 10:34 AM
Regexp and header/footer problems concern Calibre 0 02-07-2010 03:35 AM
Header/Footer Problems with conversion Sydney's Mom Calibre 4 01-05-2010 11:04 AM
How to change header/footer font? mngharry LRF 1 06-02-2009 03:01 AM


All times are GMT -4. The time now is 02:41 AM.


MobileRead.com is a privately owned, operated and funded community.