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

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 10-14-2008, 12:38 PM   #1
mdibella
Groupie
mdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheese
 
Posts: 193
Karma: 1107
Join Date: Oct 2007
Device: Infinite Kindles, Occasional Sony's
Script to convert a directory full of files?

In the 'some people are never satisfied' category...and trying real hard not to violate forum rules...


Let's assume that I have a folder full of EBooks on my Windows desktop. They are in a format that will not work on my soon-to-arrive Sony reader.

Also assume that I have a Python script (call it 'MobiDeXXX') that will magically change them into something that I can load into Calibre and then do a batch-convert to the format Sony loves.

Is there a script (or could some genius write one) that would take this entire directory and run the magic Python script against each file, one at a time, and save the results into a different directory?

Note that I am being purely lazy here, since I can of course type in the 200 file names, one at a time, into the command window and run the Python script against them.

But if anyone can help with this, I would be most grateful!
mdibella is offline   Reply With Quote
Old 10-14-2008, 01:37 PM   #2
pilotbob
Grand Sorcerer
pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.
 
pilotbob's Avatar
 
Posts: 19,832
Karma: 11842745
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
Quote:
Originally Posted by mdibella View Post
Also assume that I have a Python script (call it 'MobiDeXXX') that will magically change them into something that I can load into Calibre and then do a batch-convert to the format Sony loves.

But if anyone can help with this, I would be most grateful!
You can create a batch file... debulk.bat with the following line in it:

for %%i in (*.prc) do MobiDeXXX.py %%i %%~ni_free.prc PID

Hypothetically of course. You could even get a bit more fancy and add an IF NOT EXISTS to it to only run the command if the _free file doesn't exist. I think adding an /R after the for and it will recurse directories also.

BOb
pilotbob is offline   Reply With Quote
Old 10-14-2008, 02:21 PM   #3
mdibella
Groupie
mdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheesemdibella can extract oil from cheese
 
Posts: 193
Karma: 1107
Join Date: Oct 2007
Device: Infinite Kindles, Occasional Sony's
Worked great, thanks so much!!!
mdibella 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
Txt files - Convert to Epub - Multiple files into one book - noob help Cernan Calibre 6 05-18-2010 11:12 AM
Should Calibre take a long time to add a directory full of ebooks? jusmee Calibre 4 10-25-2009 11:34 PM
Perl Script to convert to .lrf for Sony PRS chas Sony Reader Dev Corner 7 11-22-2007 06:22 PM
Handy Perl Script to convert HTML0 files to smartquotes maggotb0y Sony Reader 0 04-12-2007 12:49 PM
gDrive 0.6 - PHP script to store files on Gmail TadW Lounge 0 02-24-2005 06:08 PM


All times are GMT -4. The time now is 09:16 PM.


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