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

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 05-15-2010, 01:33 PM   #1
Halk
Fanatic
Halk ought to be getting tired of karma fortunes by now.Halk ought to be getting tired of karma fortunes by now.Halk ought to be getting tired of karma fortunes by now.Halk ought to be getting tired of karma fortunes by now.Halk ought to be getting tired of karma fortunes by now.Halk ought to be getting tired of karma fortunes by now.Halk ought to be getting tired of karma fortunes by now.Halk ought to be getting tired of karma fortunes by now.Halk ought to be getting tired of karma fortunes by now.Halk ought to be getting tired of karma fortunes by now.Halk ought to be getting tired of karma fortunes by now.
 
Halk's Avatar
 
Posts: 516
Karma: 469999
Join Date: Feb 2008
Location: Scotland
Device: Sony PRS-650 (PRS+ alpha - thanks Kartu!)
Spurious Line Breaks

These have bothered me for a while, however I've now found a simple way to remove them, effectively.

An example of the problem would be in a .txt file where sentences are broken at the end of each line with a carriage return. The problem is that when you read the file on an electronic reader you'll end up with it looking like this.

This is a sample sentence to show how desperately frustrating it is
to read
a book formatted this way, because no matter what you do you will
always end
with too many lines in it. But as I've said I've found a simple way to
get around the problem.

Of course it would be easy to just remove every line break in the document. Problem solved... another created, because paragraphs are gone.

So the simple solution was for me (in MS Word) to replace every pair of paragraph markers with something else. Then remove every paragraph marker. and then replace every "something else" with a paragraph marker.

I'm quite sure it's possible to do that on many different text editors.

I realise it's probably not the biggest revelation in the world, but perhaps it'll help someone who has a .txt file they would like to read electronically.

I'd also be interested if someone knew of a way to do this in batches, rather than my basic time consuming way.
Halk is offline   Reply With Quote
Old 05-15-2010, 02:22 PM   #2
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
You should be able to do it all with a single find & replace if you use regular expressions. I don't know the regular expression syntax Word uses.

There are also text editors with such functionality built in, such as Ebook tidy.

For batch mode, I'm sure you could do bulk reg ex find and replaces in something like Notepad++. Or you could do it with a command line search & replaceme tool such as sed.

Don't have access to a Windows computer at the moment, or I'd give more detailed instructions. If you want instructions for linux (or, I think mac), I'd be happy to give them.

And while I could be wrong, I'd be shocked if calibre doesn't have this functionality built in, at least as something that can optionally be activated, as part of its conversion processes.
frabjous 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
PDF to EPUB - spurious paragraph breaks RichieTheK Calibre 2 09-08-2010 12:27 PM
CSS for line breaks after dashes? JaneFancher Sigil 4 04-05-2010 01:18 PM
No line breaks ecpepper Amazon Kindle 3 08-09-2009 07:42 PM
fbreader ignores line breaks red_dragon OpenInkpot 3 03-20-2009 09:38 AM
Removing extra line breaks plemming Calibre 0 07-31-2008 08:50 PM


All times are GMT -4. The time now is 04:20 PM.


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