![]() |
#1 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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**. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,263
Karma: 23661992
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 114
Karma: 1020754
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 |
![]() |
![]() |
![]() |
#4 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,671
Karma: 134319570
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
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. |
![]() |
![]() |
![]() |
#5 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. ![]() 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. ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
MIA ... but returning som
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,263
Karma: 23661992
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.
|
![]() |
![]() |
![]() |
#8 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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). |
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,263
Karma: 23661992
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. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |