Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 03-29-2010, 11: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,434
Karma: 1525776
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-30-2010, 12:36 AM   #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: 44,540
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
(?s)<hr>.*?<p class="nav">.*?</p>.*?<hr>
kovidgoyal is online now   Reply With Quote
Advert
Old 03-30-2010, 06: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,434
Karma: 1525776
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


Forum Jump

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


All times are GMT -4. The time now is 12:16 AM.


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