View Single Post
Old 10-02-2009, 01:14 PM   #9
orion2001
Groupie
orion2001 can name that song in three notesorion2001 can name that song in three notesorion2001 can name that song in three notesorion2001 can name that song in three notesorion2001 can name that song in three notesorion2001 can name that song in three notesorion2001 can name that song in three notesorion2001 can name that song in three notesorion2001 can name that song in three notesorion2001 can name that song in three notesorion2001 can name that song in three notes
 
Posts: 162
Karma: 24658
Join Date: Sep 2009
Device: PRS-505
You might find this post of mine useful:

https://www.mobileread.com/forums/sho...2&postcount=16

Komodo edit seems to be the best at handling multiline Reg expressions amongst the editors I have tested so far. My post is more for cleaning up the relevant HTML file, but you should be able to adapt it for your regular text file without much hassle.

I'd suggest removing the page numbers first as you did, and then use that type of expression to match for the required number of pagebreaks and then join the sentences if necessary. The expression makes sure to only join sentences that are incomplete. If however the sentence on the next page is a new one it will retain the linebreak. It might result in a couple of spurious paragraphs but that is something you can manually edit. The other option is to just delete all such linebreaks and fuse the sentences across pages although in that case you might end up joining two separate paragraphs if the second one started on the first line of a page.
orion2001 is offline   Reply With Quote