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

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 02-17-2012, 08:17 PM   #1
PeterPark
Junior Member
PeterPark began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2012
Device: Kindle
Out of Order Converting HTML Files with a TOC

Hey guys,
I've been struggling for a while to figure this out. I searched the forums, and the closest solution I found was to use Sigil to re-arrange the book and then convert to mobi.

Anyway, I have a ton of HTML pages, each of them I want to be its own chapter. The filename format is "#-Title.html" so for example "100-Using-Calibre.html"

I have a TOC HTML file that references each of the HTML files in increasing # order.

However, once it's converted to mobi, the book jumps from 0, 1, 10, 101, 102, and so on. Instead of obviously 0, 1, 2, 3, ...

I have some 500+ chapters/html files so doing this by hand in Sigil sounds rather time consuming.

I'm not sure what's wrong.

The only other solution I can think of is to combine all the HTML files into one HTML file. But I'm not sure how to build a TOC though. Each HTML page does have a <h1> tag title though.

Any help would be appreciated, I've spent hours here and going nuts. Initially I thought it was out of order because of the html file's creation time until I noticed this pattern.
PeterPark is offline   Reply With Quote
Old 02-17-2012, 09:12 PM   #2
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,975
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
The simplest approach is probably to rename the files to always start with 3-digits. So 1-Title becomes 001-Title, 99-Title becomes 099-Title. This is very easy to do with a script in Linux, and I assume it can also be scripted under Windows (but I don't the details of how to do this).

An approach, that works with an arbitrary order is to provide an .opf file which lists the order of the files. See ePub: OPF.
wallcraft is offline   Reply With Quote
Advert
Old 02-18-2012, 10:51 AM   #3
dwig
Wizard
dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.
 
dwig's Avatar
 
Posts: 1,613
Karma: 6718541
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
Quote:
Originally Posted by PeterPark View Post
...
I have some 500+ chapters/html files so doing this by hand in Sigil sounds rather time consuming...
If you are using Windows, the renaming can be done easily and very quickly with Bulk Rename Utility: http://www.bulkrenameutility.co.uk/Main_Intro.php

Using it requires only one pass for the single digit numbers and a second pass for the 2 digit numbers.
dwig is offline   Reply With Quote
Old 03-03-2012, 09:36 PM   #4
PeterPark
Junior Member
PeterPark began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2012
Device: Kindle
Thanks guys, I thought for some reason this thread never got posted. But using prefix zeroes definitely worked.
PeterPark 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
TOC filter and Multiple HTML Files Beedrew Calibre 1 07-20-2010 11:32 PM
Error in converting files html --> Mobipocket adamsloco Calibre 0 08-29-2009 11:30 PM
Anyone else having trouble lately converting HTML files in Calibre? ficbot Workshop 1 07-27-2009 05:15 AM
Problem converting HTML files to LRF red_five Calibre 2 06-09-2009 04:03 AM
TOC error when converting HTML poloman Calibre 2 12-14-2008 05:05 PM


All times are GMT -4. The time now is 10:05 PM.


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