View Single Post
Old 06-03-2007, 11:56 PM   #1
Raventhon began at the beginning.
Posts: 21
Karma: 10
Join Date: Jun 2007
Device: Amazon Kindle 3
Quick Reformatting of Terrible E-Books

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.
Raventhon is offline   Reply With Quote