2019-01-16 12:16:22

Hey everyone.

-So, the situation first.

I have a large number of Ebooks, around 20000 or so which i want to convert into the doc or tXT format, I decide that on the fly.
The folder looks like this. I have the main EBooks folder. For every author, I have a sub folder. If an author has written a book series, the author folder contains the sub folder with the names of the book series he has written, which then contain the books for the series.

I also have some books in the main eBooks folder which I haven't put into their authors coresponding folders yet.

What I am looking for is an accessible method of batch converting these Books, while, and this is the important part, the folder structure i already build is maintained just as I had set it up in the eBooks folder from where the converter draws the files.


I tried out Codex, problem was that Codex sorts the books by Tags and creates own folders with the tag name, which leads to quite a lot of chaos, given the fact that those books make a mess with those tags and it just makes finding things harder.
Example, When I have a folder with the author name C.S.Lewis, Codex would create a folder C.S.Lewis, and Lewis.C.S, C.S.Lewis narnia, narnia ... you get my point, I would then need to find those 4 to 5 folders and copy the files to the correct C.S.Lewis folder.

So, I am looking, as I said for a program which keeps my file structure in tact.

is there anything you would say does that job nicely

Thanks in advance.

Greetings Moritz.

Hail the unholy church of Satan, go share it's greatness.

2019-01-16 12:37:36

Is codex something that can be run with command line arguments?  For example would codex be able to be run from a dos batch file, where it's given the file path to convert?  Some converting programs support command line arguments, while others are just normal windows programs that require you to navigate lists and menus to get things done.

- Aprone
Please try out my games and programs:
Aprone's software

2019-01-16 15:29:36

I know that calibre has a command line tool called ebook-convert that can convert ebooks into other formats such as txt, html, and rtf. Problem is, it doesn't recurse. SO you'd have to write your own batch file which recursively checks the directories for ebooks and converts them.

Roel
golfing in the kitchen

2019-01-16 19:48:35

That's was I was thinking too roelvdwal, meaning writing your own batch files.  A little tool could very easily be thrown together that recursively checks the folders and writes down the path + file name for each ebook it finds.  When writing down these paths into a file, it would actually be filling in the rest so it's making 1 long batch file where every line is set to convert one of the 20000 books.

- Aprone
Please try out my games and programs:
Aprone's software

2019-01-16 20:26:03 (edited by Ethin 2019-01-16 20:30:44)

If you have Cygwin, Scoop, or a Linux environment, you could also do something like:
find . -name "*.epub" -type f -exec "ebook-convert '{}' .txtz" \;
The formats ebook-convert can convert to are azw3, docx, epub, fb2, html, htmlz, lit, lrf, mobi, oeb, pdb, pdf, pml, rb, rtf, snb, tcr, txt, and txtz (though I haven't gotten some of them to work, e.g.: html). To set the output format, just use .<format> after the books filename, where <format> is any of the formats I listed above. ebook-convert accepts the following formats: azw4, chm, comic, djvu, docx, epub, fb2, htlz, html, lit, lrf, mobi, odt, pdb, pdf, pml, rb, rtf, recipe, snb, tcr, and txt.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2019-01-16 21:47:13

I've been using ebook-convert for some time as well and it works quite well and reliably. Although you have to know how to write batchfiles. And as Ethin also stated, using bash in Unix like systems works the best in my opinion.