View Single Post
Old 10-26-2010, 05:16 PM   #3
citac
Fanatic
citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.citac ought to be getting tired of karma fortunes by now.
 
Posts: 556
Karma: 1020204
Join Date: Sep 2008
Location: Bosnia and Herzegovina
Device: Lenovo Yoga Tab 2 (Android)
Quote:
Originally Posted by Jellby View Post
I guess true paragraph breaks are represented as two consecutive breaks (aka empty line), right?

In that case, you can use something like (without regexp):

Replace all paragraph breaks with "¬" (or some other unused char).
Replace all occurrences of "¬¬" with a paragraph break.
Replace all other occurrences of "¬" with a space.
Code:
No, it's text that has short lines, 
a break comes after several words
and is very annoying to read on an
e-reader. There are no extra lines in
between. Sometimes I get this, 
    which is even worse, and 
    has to be taken care of as well.

  Or I get
      this, which looks like coding a text
  like a poem, 
      which is the worst.
See how bad it looks? I tried the above on a .txt file and it worked, thank you! I will have to try it out with various files, but I think the extra spaces shouldn't be hard to remove.

(Um, I totally misread this line "I guess true paragraph breaks are represented as two consecutive breaks (aka empty line), right?". Yes, you're right. I'll leave the above representation as an illustration. )

Last edited by citac; 10-26-2010 at 05:19 PM.
citac is offline   Reply With Quote