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

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 02-28-2010, 05:01 PM   #1
Storm27
Connoisseur
Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.
 
Posts: 74
Karma: 201290
Join Date: Aug 2009
Device: Sony PRS T3S, android phone
Bulk convert Word to Mobi?

If I have a large number of word documents that I want to convert to mobipocket format, is there a one step way of doing so? Ideally the file names would be left unchanged.

(I know that I can convert them on an individual basis by importing into mobipocket reader one by one and I know that calibre would do a bulk conversion if I changed them all to rtf first, but is there a way of not having to change or edit the files individually?)
Storm27 is offline   Reply With Quote
Old 03-01-2010, 12:49 PM   #2
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
Sure, you can.

My usual suggestion in a case like this would be to first bulk-convert the .doc files to .html (--.rtf would work too, as you noted--), and bulk-convert the html files to .mobi.

I personally do bulk conversions from .doc or .docx with the command line tools provided by AbiWord. (I don't know how to do it with MS Word, or even if it's possible.)

Here are fairly detailed instructions, which includes the conversion to Mobi using calibre's command line tools. (You don't even need to fire up calibre's GUI.)

Here's one way you can do it under Windows.

I'm covering both .doc (older versions of Word) and .docx (Word '08+) files here; let me know if you just want one or the other.

1. Download and install calibre. (Sounds like you already have.)
2. Download and install AbiWord. It's completely free.
3. On a 64 bit WIndows, copy and paste the following lines into Notepad.

Quote:
for %%I in (*.docx) do "C:\Program Files (x86)\AbiWord\bin\AbiWord.exe" --to=html "%%I"
for %%I in (*.doc) do "C:\Program Files (x86)\AbiWord\bin\AbiWord.exe" --to=html "%%I"
for %%I in (*.html) do "C:\Program Files (x86)\Calibre2\ebook-convert.exe" "%%I" "%%~nI.mobi"
On 32 bit Windows, use this instead:

Quote:
for %%I in (*.docx) do "C:\Program Files\AbiWord\bin\AbiWord.exe" --to=html "%%I"
for %%I in (*.doc) do "C:\Program Files\AbiWord\bin\AbiWord.exe" --to=html "%%I"
for %%I in (*.html) do "C:\Program Files\Calibre2\ebook-convert.exe" "%%I" "%%~nI.mobi"
The only difference between those are the path where you find the executables for calibre and AbiWord. It's probably a good idea to double check that my assumptions about where those programs are installed on your computer are correct. If they're not, you may need to change the parts:

"C:\Program Files\AbiWord\bin\AbiWord.exe" (twice)
"C:\Program Files\Calibre2\ebook-convert.exe"

to whatever the right paths are.

4. Save the file in notepad with something ending in .bat that you'll remember, e.g., "word2mobi.bat". Save it in the same folder as the files you want to convert.

5. Navigate to that folder in Windows Explorer or My Computer and double click on the file "word2mobi" (or whatever you named it).

6. A batch file will then run in a terminal screen which will bulk-convert all the .docx and .doc files in that folder to .html, and then, bulk-convert all the html files to .mobi (It is possible to use .rtf files instead -- let me know if you want to try that.)

7. The file names will remain the same; I'm not sure about the metadata... you'd have to try it and see how it goes. However, be careful--look out for .mobi or .html files that are already in the folder in question with the same names as your .doc and .docx files, since they will be overwritten.

Probably there's tweaking to this process that might be worthwhile, but this is my best advice.

Remember to back up your files before trying something like this, and don't hate me too much if anything goes wrong!

I'd be happy also to give instructions for doing this under linux (which may or may not be the same as for doing it with a mac).

Last edited by frabjous; 03-01-2010 at 12:55 PM.
frabjous is offline   Reply With Quote
Old 03-02-2010, 04:50 AM   #3
Storm27
Connoisseur
Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.
 
Posts: 74
Karma: 201290
Join Date: Aug 2009
Device: Sony PRS T3S, android phone
THANK YOU!

I will have to wait till I have a bit of time at home to play around with this (I didn't know Abiword existed), but it's exactly what I wanted to do -- and means I won't be carrying out manual processes on 150 or so files.
Storm27 is offline   Reply With Quote
Old 03-31-2010, 09:32 AM   #4
Storm27
Connoisseur
Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.Storm27 ought to be getting tired of karma fortunes by now.
 
Posts: 74
Karma: 201290
Join Date: Aug 2009
Device: Sony PRS T3S, android phone
I just wanted to report back in case anyone else is interested in this batch file.

The good news is that both the installation and running the batch file were very easy, almost exactly as described (the only change was that I had a slightly different pathname for calibre). The Mobipocket files it produced seemed perfect.

The bad news is that within a day of carrying out the procedure, my hard drive suffered a catastrophic failure and nothing could be recovered so it will all be to do again. (I hasten to add that this process had nothing to do with the broken hard drive.)

So I have been without much computer access for awhile, but I expect to get my new machine in the next few days and I will certainly be doing this again once I have copies of all of my backed up data arranged to my liking.

I would be interested to know whether it is possible to modify the batch file to convert all (unencrypted) Mobipocket files in a particular directory to epub and to rtf as this process actually seemed quicker and cleaner than importing everything into calibre and then exporting it again.

Many thanks for the instructions!
Storm27 is offline   Reply With Quote
Old 03-31-2010, 01:09 PM   #5
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
Sure.

Quote:
for %%I in (*.mobi) do "C:\Program Files\Calibre2\ebook-convert.exe" "%%I" "%%~nI.epub"
for %%I in (*.mobi) do "C:\Program Files\Calibre2\ebook-convert.exe" "%%I" "%%~nI.rtf"
Change the path to calibre as necessary.

First line converts all .mobis to .epubs, second line converts all .mobis to .rtfs.

Sorry to hear about your harddrive crash.
frabjous is offline   Reply With Quote
Old 04-08-2010, 08:00 AM   #6
Libby Cone
scribbler
Libby Cone doesn't litterLibby Cone doesn't litterLibby Cone doesn't litter
 
Libby Cone's Avatar
 
Posts: 117
Karma: 246
Join Date: Dec 2008
Location: Philadelphia USA
Device: Kindle
I have Linux on a 64-bit machine, and I uploaded a .doc file (saved in OpenOffice) to Smashwords after laboriously deleting all the tabs, indenting the first line of all paragraphs (I was able to do that automatically), and then de-indenting all lines of dialogue beginning a paragraph. I have AbiWord but don't use it. Would this have been easier in AbiWord?
Libby Cone is offline   Reply With Quote
Old 04-08-2010, 10:13 AM   #7
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
You did each line of the entire book by hand?

Surely you could have used one find and replace to remove the tabs (either in AbiWord or OpenOffice, or in the output file). And you could use styles to indent/de-indent paragraphs. How hard this would be would depend on whether the .doc file used styles, or there is some other easy way for a computer to determine which lines should be indented and which not. (I didn't really understand what you meant by lines of dialogue nor why they should be treated differently than other paragraphs.) If so, it should have been possible to do it in either one easily enough.

Actually despite my signature, I don't use either OpenOffice or Abiword that much, except to convert things. I generally prefer just to edit mark-up code (either LaTeX or HTML) in a text editor. How easy it would be to make global changes to a document after conversion really depends on how messy the source document was to begin with. Word documents are often messy, and HTML exported from Word a nightmare. Certainly, HTML exported from AbiWord is cleaner and easier to work with. But if the source Word document was a mess (which they often are, since Word encourages sloppy habits), there's not much you can do except a lot of manual editing.
frabjous is offline   Reply With Quote
Old 04-09-2010, 08:32 AM   #8
Libby Cone
scribbler
Libby Cone doesn't litterLibby Cone doesn't litterLibby Cone doesn't litter
 
Libby Cone's Avatar
 
Posts: 117
Karma: 246
Join Date: Dec 2008
Location: Philadelphia USA
Device: Kindle
[QUOTE=frabjous;862441]You did each line of the entire book by hand?

No, it was mainly every line beginning with a tab and every line beginning with quotation marks. I could not figure out how to get rid of the tabs using Find/Replace on OpenOffice; I tried "^t" and it did not recognize it. I tried hitting the tab key in the find space and it didn't like that, either. Once I got rid of all the tabs I used a paragraph command to indent the first line of each paragraph using a ruler, but there was no command to exempt lines beginning with quotation marks, which are traditionally not indented, so I had to de-indent those lines by hand. it took less than an hour, actually.

"Surely you could have used one find and replace to remove the tabs (either in AbiWord or OpenOffice, or in the output file). And you could use styles to indent/de-indent paragraphs. How hard this would be would depend on whether the .doc file used styles, or there is some other easy way for a computer to determine which lines should be indented and which not. (I didn't really understand what you meant by lines of dialogue nor why they should be treated differently than other paragraphs.) If so, it should have been possible to do it in either one easily enough."


The source document was written in OpenOffice and saved as a .doc file. I generally don't use styles (though I probably will now!). In case you haven't guessed, I'm not a text-editor chick, and I don't know HTML. My software engineer husband keeps telling me to learn them, but I find them very difficult.
Libby Cone is offline   Reply With Quote
Old 04-09-2010, 09:06 AM   #9
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
The OpenOffice regex for tab is "\t", at least according to this. (I haven't tried it myself.)

If you want to stick with WYSIWYG, using styles is really the best way to make global changes to a document easy. It gets very tricky otherwise.
frabjous is offline   Reply With Quote
Old 04-16-2010, 07:06 AM   #10
Libby Cone
scribbler
Libby Cone doesn't litterLibby Cone doesn't litterLibby Cone doesn't litter
 
Libby Cone's Avatar
 
Posts: 117
Karma: 246
Join Date: Dec 2008
Location: Philadelphia USA
Device: Kindle
Quote:
Originally Posted by frabjous View Post
The OpenOffice regex for tab is "\t", at least according to this. (I haven't tried it myself.)

If you want to stick with WYSIWYG, using styles is really the best way to make global changes to a document easy. It gets very tricky otherwise.
"/t"? I'll try it! Thanks.
Libby Cone is offline   Reply With Quote
Old 08-24-2013, 11:26 AM   #11
kageroh
Junior Member
kageroh can teach chickens to fly.kageroh can teach chickens to fly.kageroh can teach chickens to fly.kageroh can teach chickens to fly.kageroh can teach chickens to fly.kageroh can teach chickens to fly.kageroh can teach chickens to fly.kageroh can teach chickens to fly.kageroh can teach chickens to fly.kageroh can teach chickens to fly.kageroh can teach chickens to fly.
 
kageroh's Avatar
 
Posts: 8
Karma: 3852
Join Date: Aug 2013
Device: Kindle Paperwhite
For some reason the bat converts 9 of the 23 docs I have in the folder I want to convert, then crashes after creating the first mobi.
kageroh 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
Bulk Convert problem - prefered format input captpete Calibre 4 08-24-2010 09:26 AM
Convert word DOCs when you don't have WORD ? heheh macthekitten Calibre 9 01-30-2009 07:41 AM
Converting pdf or Word to mobi with formatting pfisterfarm Kindle Formats 4 01-01-2009 11:50 AM
Bulk Convert Messes up Authors TheHeartlessHero Calibre 1 09-11-2008 08:05 PM
Bulk Convert error seajewel Calibre 1 08-06-2008 05:13 PM


All times are GMT -4. The time now is 03:46 AM.


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