03-02-2010, 03:02 PM | #46 |
Wizard
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
|
No problem, but if you're just converting HTML to ePub, you could run calibre and drag the file or file(s) into the calibre window, and use the rather more user-friendly conversion menus in there. Not that there's anything wrong with using my script... it's that most people prefer graphical user interfaces to command-line shell scripts.
|
03-04-2010, 04:58 PM | #47 | |
Member
Posts: 11
Karma: 66
Join Date: Mar 2010
Device: Sony Reader Daily (PRS-900)
|
frabjous, thanks, this is a useful method - i don't need to use sony's reader library for this anymore (I still need to check if abiword supports docx though).
by the way, the content of the doc2epub.bat file can be replaced with: Quote:
Last edited by adikira; 03-04-2010 at 05:31 PM. |
|
Advert | |
|
03-04-2010, 06:22 PM | #48 |
Wizard
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
|
That's a nice tip, thanks. I don't usually use Windows, so I was trying to figure out how to do that on the fly. (I'm used to executables being put in my "path".) Anyway, thanks.
AbiWord supports .docx -- at least any recent version does. (Of course, you'll need to change (*.doc) to (*.docx) or (*.doc *docx) in the batch file.) If installing on Windows, be sure to do a custom install and check to install the extra import and export plugins. I think you get .docx even without installing the extras, but that way you even get relatively arcane things, like latex. |
03-05-2010, 11:43 AM | #49 | |
Member
Posts: 11
Karma: 66
Join Date: Mar 2010
Device: Sony Reader Daily (PRS-900)
|
Welcome. I use a lot of Unix shell scripting at work but at home I still use Windows. When it comes to command line scripting Windows completely sucks! I may give powershell a try though.
Anyway, I updated the batch file to give more flexibility. It can take two arguments the file extension that you are converting from and the extension you are converting to (which defaults to epub if missing). If the extension you are converting from is doc or docx it first runs AbiWord to convert to html first otherwise it just uses Caliber's convertor. It should be saved to a batch file such as "convert.bat." It's recommended that this file (convert.bat) is saved in the Windows directory so that it's in the PATH variable and can be called up from any folder. Otherwise the full path the the convert.bat needs to be specified or it needs to be in the current folder (of course). Quote:
Last edited by adikira; 03-05-2010 at 11:47 AM. |
|
03-05-2010, 12:26 PM | #50 |
Wizard
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
|
Excellent.
I'm learning stuff about Windows batch files by looking at it. Since, like you, I normally just write Unix/linux shell scripts (e.g. bash), writing batch files for Windows usually only comes up for me when I want to help someone here and need a way to translate something I already know how to do in linux to Windows. This will be very helpful. I guess the only downside to your method, however, is that since it needs to be passed arguments, you can't tell someone just to cut and paste into Notepad, save and double click the icon -- the people actually have to go to the command prompt and navigate to the appropriate folder. Not really a difficult concept for those of us who remember DOS, or use UNIX/linux where this is relatively commonplace, but a number of Windows users who come here looking for help are often intimidated by doing anything through a command line interface, unfortunately. (Though I suppose you could just make two batch files, with one calling the other if need be.) Last edited by frabjous; 03-05-2010 at 12:30 PM. |
Advert | |
|
03-05-2010, 06:08 PM | #51 |
Addict
Posts: 228
Karma: 16000
Join Date: Jun 2009
Device: Sony PRS-T1
|
The latest beta version of Atlantis Word Processor has the "batch conversion" command:
https://www.mobileread.com/forums/sho...673#post817673 |
03-05-2010, 11:38 PM | #52 | |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
|
|
03-09-2010, 01:16 PM | #53 |
Enthusiast
Posts: 36
Karma: 10
Join Date: Feb 2010
Device: BeBook Neo / Onyx Boox 60
|
Glad I found this as it's proving most useful, Thanks!
Any Idea how to get "Author - Title.doc" from the file name? |
03-09-2010, 02:10 PM | #54 |
Addict
Posts: 228
Karma: 16000
Join Date: Jun 2009
Device: Sony PRS-T1
|
Did you mean how to get "author" and "title" from a DOC filename when using the Batch Conversion command of Atlantis Word Processor? If so, the "Batch conversion" command of the latest version of Atlantis retrieves this information from the source document in the following way.
It checks the document Properties (you can view them in Atlantis if you open a document in Atlantis, then choose the "File | Properties..." menu command of Atlantis). If the "Title" property is not blank, Atlantis uses it as the "Title" EPUB metadata item. If the "Title" property is blank, Atlantis uses the document filename without the file path and extension. If the "Author" property of the source document is not blank, Atlantis uses it as the "Author" EPUB metadata item. Otherwise the "User name" from the "General" tab of the "Tools | Options..." window of Atlantis is used. So Atlantis currently does not retrieve the Author name from the filename of the source document. If everyone named document files in "your way" (I mean "<author name> - <book title>.<file extension>"), it would be fairly easy to adjust the "Batch conversion" feature of Atlantis to retrieve this information from names of source document files. |
03-09-2010, 05:26 PM | #55 |
Enthusiast
Posts: 36
Karma: 10
Join Date: Feb 2010
Device: BeBook Neo / Onyx Boox 60
|
Thanks for that response AWP
How about frabjous and adikira, I know that batch files can (but can't remember how) parse the files name, but can you pass that to Calibre to enter the Author and Title Fields automatically. |
03-09-2010, 06:35 PM | #56 |
Wizard
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
|
My knowledge of Windows batch files is very limited -- hopefully adikira will chime in, but I *think* something along these lines should work to parse Author-File.doc to the metadata:
(For 64 bit Windows, just converting .doc to .epub) Code:
for %%I in (*.doc) do ( for /f "tokens=1,2 delims=-" %%a in ("%%~nI") do ( "C:\Program Files (x86)\AbiWord\bin\AbiWord.exe" --to=html "%%I" "C:\Program Files (x86)\Calibre2\ebook-convert.exe" "%%~nI.html" "%%~nI.epub" --authors="%%a" --title="%%b" ) ) Code:
for %%I in (*.doc) do ( for /f "tokens=1,2 delims=-" %%a in ("%%~nI") do ( "%PROGRAMFILES%\AbiWord\bin\AbiWord.exe" --to=html "%%I" "%PROGRAMFILES%\Program Files (x86)\Calibre2\ebook-convert.exe" "%%~nI.html" "%%~nI.epub" --authors="%%a" --title="%%b" ) ) No clue what that will do with files that don't have dashes in them. Too lazy to check. This would be very easy on linux. |
03-10-2010, 04:21 AM | #57 |
Enthusiast
Posts: 36
Karma: 10
Join Date: Feb 2010
Device: BeBook Neo / Onyx Boox 60
|
That worked great. Saved me a lot of (immediate) reading I use batch/dos so rarely any more that I have to learn all over again when I need it. Its so useful and quick, when you know how. E.G concatenating text files... I should now be able to adapt your scripts to my needs. Always easier from a working example. Last edited by Fith; 03-10-2010 at 04:28 AM. |
04-22-2010, 04:16 PM | #58 |
Enthusiast
Posts: 32
Karma: 10
Join Date: Oct 2009
Device: Nook
|
thanx frabjous, batching make life much easier
i tried first using the one line command but it didn't work, adding sleep 30 did the magic, much appreciated |
07-05-2010, 05:20 AM | #59 | |
Junior Member
Posts: 3
Karma: 10
Join Date: Jul 2010
Device: ipad
|
frabjous,
i did the same what you say to Laura81 Quote:
>>>>>>>>>>>>>>>>>>> Laura81, how mony days it take from you to converte your docs?? |
|
07-05-2010, 11:59 AM | #60 | |
Wizard
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
|
Quote:
Obviously something has gone wrong. It’s impossible for me to tell what’s gone wrong, because you didn’t provide any information about what happened. Were the html files created for all the docs? |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hebrew Doc file to epub | logie072 | ePub | 3 | 08-27-2010 11:31 AM |
need advice doc/html to epub | ebooker | Workshop | 2 | 08-14-2010 10:06 PM |
Converting .doc to epub . . . | michael180 | General Discussions | 2 | 06-08-2010 08:54 PM |
Doc to Epub convertion problems | johnbajer | Calibre | 5 | 06-04-2010 05:30 PM |
Problem converting doc to epub | Laura81 | Calibre | 3 | 01-26-2010 06:03 PM |