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

Go Back   MobileRead Forums > E-Book Readers > Sony Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 11-11-2007, 11:10 AM   #1
BlackVoid
Evangelist
BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.
 
Posts: 415
Karma: 510423
Join Date: Nov 2006
Device: Sony PRS-505
Batch conversion of txt

I have a lot of text in txt format and I would like to batch convert all of them to lrf. Yes, I know I could convert 1 by 1, but I would like to put the books on SD cards. The way the Reader handles txt files is quite bad (line breaks).

Is there a good tool to batch convert a lot of files? I have tried libprs500, but that program is a JOKE. If I try to convert a lot of text files, I have to specify formatting information for each book (margin), because it forgets the settings (???). txt2lrf cannot handle *.txt which is just plain weird. Really. I appreciate the effort that went into libprs500, but it really is a major pain to use. It is not good for batch conversion at all. Also it is weird. Conversion does not save? Output goes into separate sub directories? Major weirdness!

Is there a nice program that can batch-convert?

My other issue is, that some of my files have something like this every couple of pages:
file:///K|/eMule/Incoming/Poe,%20Edgar%20-%20Crow%20(v1.0)%20[html].html (3 of 252)8-12-2006 23:41:53
Crow

Any good tool that can remove such garbage from txt files?

And my 3rd question:
Where can I find specification for the lrf format? I am a programmer myself and contemplating to write a nice converter that it is not a major pain in the a**.
BlackVoid is offline   Reply With Quote
Old 11-11-2007, 11:39 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,940
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
All the *2lrf commands are not designed for batch conversion. If you want to do batch conversion, write a script. You claim to be a programmer, its not that hard.
kovidgoyal is offline   Reply With Quote
Old 11-12-2007, 02:46 AM   #3
Red Alert
Zealot
Red Alert ought to be getting tired of karma fortunes by now.Red Alert ought to be getting tired of karma fortunes by now.Red Alert ought to be getting tired of karma fortunes by now.Red Alert ought to be getting tired of karma fortunes by now.Red Alert ought to be getting tired of karma fortunes by now.Red Alert ought to be getting tired of karma fortunes by now.Red Alert ought to be getting tired of karma fortunes by now.Red Alert ought to be getting tired of karma fortunes by now.Red Alert ought to be getting tired of karma fortunes by now.Red Alert ought to be getting tired of karma fortunes by now.Red Alert ought to be getting tired of karma fortunes by now.
 
Red Alert's Avatar
 
Posts: 111
Karma: 1004314
Join Date: Jul 2007
Location: Silverdale, Washington
Device: NookColor & Nook Tablet. Sony PRS-505 loaned to brother.
Kovidgoyal,

I like your response! Now is the time to see if BlackVoid is willing to spend the time, as you have, to develop translation tools.

Thanks.

Red
Red Alert is offline   Reply With Quote
Old 11-12-2007, 04:37 AM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 37,075
Karma: 18147936
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Unless you have every single text file setup in the exact same format, it's not possible to batch convert. You need them in the same format so that you can pick up the title and the author for the metadata.

And the way to remove that garbage is not to use emule to download such poorly formatted books.
JSWolf is online now   Reply With Quote
Old 11-15-2007, 04:05 PM   #5
BlackVoid
Evangelist
BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.
 
Posts: 415
Karma: 510423
Join Date: Nov 2006
Device: Sony PRS-505
My converter is in progress and a beta should be ready soon. It will remember your conversion settings, the input directory and the output directory.
The program will use any2lrf, so it will be capable of converting all files in a directory. The program is just a shell and will use the already existing conversion tools - which are SLOW. If anyone provides me detailed lrf specs, I might do a proper converter, but I do not have time reverse engineer the format.

JSWolf: Yes if the author and title information is stored in a different way for the books, then the conversion will not properly put this info into the lrf. My program assumes that there is a distinct separator character in the filename. eg: Daniel Defoe - Robinson Crusoe.txt <= this will be correctly transformed if you provide the separator. With no separator, the title will become the filename and the author will not be filled in the lrf. Still better than to convert 1 by 1 hundreds of files.

This converter is actually not a big deal, only a few hours work, but unfortunately I do not have more time. At least it is very convenient for batch transfers and will REMEMBER your settings.
BlackVoid is offline   Reply With Quote
Old 11-15-2007, 04:31 PM   #6
tirsales
MIA ... but returning som
tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.
 
tirsales's Avatar
 
Posts: 1,600
Karma: 511342
Join Date: Nov 2007
Location: Germany
Device: PRS-505 and *Really* not owning a PRS-700
Removing garbage from txt-files? What is the big deal? Pattern matching in ANY programming language should do the trick. I mean ... Perl could probably do this in a handfull of lines.

@BlackVoid: Btw: I have not participated in the development of the mentioned programs in any way, but I am a programmer myself, though take this as a kind of "neutral spotters opinion":
You are rude. (Destructive) criticism of (free) programs like "is a major pain in the a**" without constructive proposals is a no-go.

Why should the program store the settings? If used on the commandline those settings can be stored in a script, normally you will need new settings for each conversions, ... - though storing the sessions will actually be more of a handicap than not doing it ..
I *don't* like my command-line-programs to store *any* settings, unless they can be changed in a text-only settingsfile. Just saving my session-settings? No, please, no!. Just my 2 cent.

Last edited by tirsales; 11-15-2007 at 04:40 PM.
tirsales is offline   Reply With Quote
Old 11-15-2007, 04:54 PM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,940
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@BlackVoid: As tirsales points out. command line programs shouldn't store settings. any2lrf is designed to have a script wrapped around it for batch conversions. The converters are slow because they dont do a direct txt->lrf conversion, all the converters first convert to html and then to lrf. And the html converter sacrifices speed for ease of maintainability, extensibilty and memory usage. After all conversion is typically a onetime thing where its more important to get things right than to do them quickly.
kovidgoyal is offline   Reply With Quote
Old 11-17-2007, 04:36 PM   #8
BlackVoid
Evangelist
BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.BlackVoid ought to be getting tired of karma fortunes by now.
 
Posts: 415
Karma: 510423
Join Date: Nov 2006
Device: Sony PRS-505
I was talking about libprs500. My criticism about it:
It does not remember input dir. It does not remember output dir. It does not remember margin settings, even when converting multiple files - it has to be set 1 by 1. In case of multiple file conversion it starts a lot of jobs instead of progressing one bye one - this is much slower. It stores files redundantly (library + wherever you input from and wherever you save to) - what is the point?

The command line tools do the job, I was not criticizing them. Sorry if I came across as rude, it was not the intention.

My converter is functional now, I am going to up it in a few days (one more bug to fix).
BlackVoid is offline   Reply With Quote
Old 11-17-2007, 09:53 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,940
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's because the bulk conversion GUI is not written yet, as you'd discover if you click the arrow next convert ebooks button. I personally much prefer the command line for doing bulk conversions.

It doesn't start multiple conversion jobs simultaneously all but the first are blocked waiting on a lock.

Remembering global defaults in the GUI is on my TODO list.
kovidgoyal 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
Batch convert txt to prc Petest Kindle Formats 4 03-03-2009 04:29 AM
pdftohtml Batch Conversion kad032000 Sony Reader 8 06-27-2008 09:50 AM
Batch conversion html to lrf lilpretender Sony Reader 5 04-22-2008 09:22 PM
how to do batch conversion with libprs mazzeltjes Calibre 8 02-12-2008 09:24 AM
tips for batch conversion with emacs klikklak Sony Reader 0 11-14-2007 12:02 PM


All times are GMT -4. The time now is 06:40 PM.


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