View Single Post
Old 06-05-2007, 11:48 AM   #5
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: 36,690
Karma: 17734032
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by Raventhon View Post
I've been thinking, and as I don't actually know perl myself I'm unable to write the script for it, but a script that did the following would be amazingly useful in formatting eBooks for viewing on mobile devices.

Scan all files in a directory (and subdirectories, hey, why not) and replace all instances of <newline> not immediately followed by either <newline> or <tab> with a single space.

Reasoning behind this: I've seen entirely too many eBooks formatted such that they use manual line breaks instead of using the word wrap feature, and when transferred to a mobile device, you end up with fragmented lines:

"This is a bunch of text serving as example of
incorrect word
wrap due to stupid formatting of eBooks. I really
wish there was
some way to fix it, because it's almost impossible
to read this
terribly formatted text."

Can anyone think of any files they have that this command would damage? I wouldn't want to run it on poetry, but other than that, it seems that this script can be safely run on normally-formatted eBooks without changing anything.
Are you talking about purchased, "downloaded", or books from sites like Project Gutenberg?
JSWolf is online now   Reply With Quote