As part of my current activities for migrating from Plucker to Mobipocket I was faced to mass convert approx. 500 ebooksfrom single-file-html format to mobipocket .mobi/.prc format. Actually, a lot of the ebooks were in text format, lit format and pdf format originally and were then converted for reading on a Nokia smartphone into text format some time back using tools ABC Amber Lit converter when appropriate.

I did not simply want to drag-and-drop all the text files into the windows mobipocket reader as I want to have at least the title and author tags properly set. Dragging and dropping a bunch of files will not do that - quite the opposite: the file name will be the title of the resulting mobi ebook and the author will either left empty (if you are lucky) or set to some random value (if you are unlucky - depending on your circumstances).

Now I tried to mass convert the text files with mobiperl or mobigen instead but they proved unsuitable for direct conversion with either of those two tools.

So I downloaded "Easy Text to HTML Converter" and batched my ~500 text files for conversion into HTML using said tool's default template. That was slow but steady - the job was finished ~ 24 hours later (with some other unrelated stuff like DVD burning going on the conversion machine). (see also below)

That netted me my ~500 html ebooks now - so far, so good. At this point let me remark not to ever delete your original lit/pdf/any format source ebook files like I did in the past - you never know when you might need them again !!! And don't be cocksure about what can be deleted: I was ....

For the html mass conversion I decided to write a script to achieve this goal. I started out with using mobiperl and ended up using the win32 executable of mobi2html with a single line "Windows Command processor" (cmd) which did converted my html to .mobi files just fine. The only problem was that almost every of the ebooks generated showed up in the list of the Mobipocket windows reader just fine but could not be opened resulting in a file corruption error message. The ebooks concerned were the files generated from the text to HTML conversion using "Easy Text to HTML Converter"'s default template. No twiddling would change this result - so I abandoned mobiperl because it has obvious problems with the shitty/complicated/whatever-it-is HTML generated by "Easy Text to HTML Converter"'s default template.

I recommend for anybody to stay away from "Easy Text to HTML Converter"' based on my experience.

My next approach for mass conversion was to use mobigen. But a opf project file is needed for every ebook to be generated if one wants the author and titles properly set .... I fired up Mobipocket Creator and converted a single HTML file to Mobipocket and looked at the resulting .opf file: To my surprise it was simply XML serialized in a single line text file ... tadaaa. Now I knew that I was almost home free if mobigen could handle the "Easy Text to HTML Converter" output.

I ran mobigen on the opf file generated by Mobipocket Creator and the result was to my delight a "rather usable" Mobipocket ebook which worked in the Mobipocket Windows Reader.

I then wrote a Visual Basic Script for generating appropriate opf files and running mobigen for the conversion.

So this is what I did in the directory where my ebook html files are stored:

(0) Change all file extensions .htm to .html. You can use

Code:

LUPAS Rename 2000

for this task.

(1) Preparation of the HTML files' file names: (This is an optional step) I used "LUPAS Rename 2000" to clean up the file names of my HTML files. This step included for me replacing "_" with white space, replacing sequences of two or more white spaces with a single white space and removing angular brackets in the file names. The result of a this are a bunch of files having file names of the form

is installed and current. This is definitely an issue for Win9x/Me users, possibly an issue for Win2k users, most likely not an issue for WinXP (even unpatched) users and no issue at all for Vista or Win7 users.

Code:

Microsoft Windows Scripting Host

can be obtained from Microsoft downloads (get at least version

Code:

5.6

or

Code:

5.7

).

(4) Make sure the files

Code:

00-template.opf

,

Code:

00-2mobi.vbs

are in the ebook directory. Put your own cover for the mobipocket e-books to be generated with the name

Code:

00-cover.jpg

into the ebook directory.

(5) In your ebook directory run:

Code:

cscript 00-2mobi.vbs

That's it if you have done everything according to the above procedure. Now you should find an .opf Mobipocket project file and a .mobi Mobipocket ebook file for every html file unless mobigen has a problem with one file or the other.

I have auto generated HTML Files (nearly 200) and I want to convert as a single MOBI File.

I had tried using the Mobipocket Creator.But Only the partial content are Displayed.How to i generate the table of contents.

Thanks

Velu

I had this come up, too, sometime back one way or the other ... I used a freeware "dir2html" (Google it or Softpedia maybe?) to generate an HTML document containing a bare bones (you need deselect some "dir2html" options for that in order to disable some "fluff") listing of all the HTML files in the directory and then edited is manually to "beautify" it. I used that one then as a TOC for the further conversion process with Mobipocket Creator.

This worked pretty well: Find your document in the TOC, jump to it, read it until you are done and then use the "Back" function in the Mobipocket Reader until you back in the TOC.