10-25-2010, 09:33 PM | #1 |
Fanatic
Posts: 550
Karma: 1020204
Join Date: Sep 2008
Location: Bosnia and Herzegovina
Device: Lenovo Yoga Tab 2 (Android)
|
Removing unnecessary paragraph breaks in .txt
I have a problem I hope someone will help me solve. I have a large number of .txt files, mostly fic saved from various websites. Some of it saved fine, and is displayed correctly on my e-reader, but some of it has a paragraph break at the end of each line.
If I try to remove those extra paragraphs in Word, it removes all paragraphs, and I end up with one big paragraph with no breaks whatsoever. How do I go about removing end-of-line paragraph breaks, and keeping those between paragraphs? |
10-26-2010, 04:42 AM | #2 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
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. |
Advert | |
|
10-26-2010, 05:16 PM | #3 | |
Fanatic
Posts: 550
Karma: 1020204
Join Date: Sep 2008
Location: Bosnia and Herzegovina
Device: Lenovo Yoga Tab 2 (Android)
|
Quote:
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. (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. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PDF to EPUB - spurious paragraph breaks | RichieTheK | Calibre | 2 | 09-08-2010 11:27 AM |
Paragraph breaks | thedevilsjester | Calibre | 2 | 09-07-2010 12:26 PM |
Removing unnecessary line breaks in books. | Wintersdark | Calibre | 17 | 09-04-2010 04:34 AM |
scanned PDF has weird paragraph breaks. Possible to fix | lunixer | 0 | 08-30-2010 10:47 PM | |
Create proper paragraph breaks in ereader2html | acj412 | Workshop | 2 | 08-10-2009 11:02 PM |