![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jan 2017
Device: none
|
Removing Line breaks using regex in PDF when converting
I have a PDF file with unnecessary line breaks when converting to EPUB. Heuristic processing doesn't work to remove them even if I set to 1. So I thought of using RegEx to replace those breaks with "blank"
Example 1 paying their own</p> <p class="calibre1">money Example 2 wrong.</p> <p class="calibre1">“Who did this.... I can write a regex to get lines without '.' [^\.]</p>\n<p class="calibre1"> but all this does is highlight the first character in the found string as well (i.e. the "n" from "own" in the first example) Is there any way to select the string but without removing that last character? |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Have you tried something like:
</p>$^<p class="calibre1"> If I have got my RE correct this should look for a line ending with the <p> tag and the next line starting with the open paragraph tag. You would want to replace this all by a single space. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jan 2017
Device: none
|
The thing is - I only want to replace the lines that don't end with a fullstop '.'.
|
![]() |
![]() |
![]() |
#4 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 423
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Line breaks when converting to pdf | maffia | Conversion | 2 | 05-05-2015 03:27 AM |
Removing paragraph breaks present after every line in EPUB? | Snakey | Calibre | 6 | 12-17-2010 11:08 AM |
Removing unnecessary line breaks in books. | Wintersdark | Calibre | 17 | 09-04-2010 04:34 AM |
Removing Line-breaks / Preserving Paragraphs | ahi | Workshop | 5 | 06-08-2009 02:22 AM |
Removing extra line breaks | plemming | Calibre | 0 | 07-31-2008 07:50 PM |