01-17-2013, 09:43 AM | #181 |
Member
Posts: 21
Karma: 10
Join Date: Jan 2013
Device: none
|
theducks,
it was #1 . What a shame! Thank you! |
01-25-2013, 11:43 PM | #182 |
Junior Member
Posts: 1
Karma: 34
Join Date: Jan 2013
Device: K3
|
Find & fix quote in split paragraphs
In Sigil this expression has been helpful:
(“[^”\r\n]*)</p>\s+<p class="calibre."> Replace with (has a trailing space): \1 This indentifies paragraphs where a opening smart quote is not matched with a closing smart quote and joins that paragraph with the next one. Its not fool proof, but saves a lot of time. I use calibre conversion to switch straight quotes to smart quotes. Its under "Look Feel", check by "smarten punctuation". Easier to fix its mistakes than to find and fix 'em all. Good Luck! |
01-26-2013, 09:27 AM | #183 | |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Quote:
In calibre, you can use the 'modify e-pub' plugin that can do the smarten punctuation, without a full conversion. |
|
02-01-2013, 05:52 AM | #184 |
Junior Member
Posts: 2
Karma: 10
Join Date: Feb 2013
Device: none
|
I've read previous posts but my problem is either not covered in them or I simply missed it.
How can I, in the Replace field in Sigil, refer to part of the search regex given in the Find field? For example, the text "theAmerican" should be changed to "the American". The Search field is easy, "[a-z][A-Z]" but "[a-z] [A-Z]" does not work in the Replace field beacause Sigil replaces the regex text as a literal instead of keeping the lower case and the upper case letters, whatever they are. I have almost no knowledge of regular expressions, please help me in this. |
02-01-2013, 06:26 AM | #185 | |
Grand Sorcerer
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Find: ([a-z])([A-Z]) Replace: \1 \2 For more information search for backreferences. |
|
02-01-2013, 08:26 AM | #186 |
Junior Member
Posts: 2
Karma: 10
Join Date: Feb 2013
Device: none
|
It works perfectly, thank you so much, Doitsu!
|
02-02-2013, 09:06 AM | #187 |
Guru
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
|
I'm off topic here, as this is about a *.CBR and otherwise has nothing to do with Sigil, but the recent post reminded me I meant to inquire.
I've got a series of images with a page number added at the end, but the existing page numbering is a disaster. Is there a means of stripping any ending numbers (only), without removing numbers from other locations in the filename? Ultimately I want my output to look like: Terminator 2 -- ch14 pg023.jpg With preceding zeros as placeholders to force proper viewing order. I've tried: [0-9,3] to find the page numbers, but that removes all of the numbers in the example filename shown above. If I try appending the $, then I get no matches. I know it has to be something I am doing wrong. Adding page numbers back in is a straight %03d replacement which I've been doing as a second step after stripping the pages (it's a total renumber, nothing can be saved). PS: My apologies if this message needs to be moved, but I wasn't sure where else it might be more relevant within the forums. |
02-02-2013, 09:55 AM | #188 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
I take it you're extracting, using a proper re-name util, then re-packing.
Search : (.*pg)\d{1,3}(\.jpg) (stores all upto (and including) 'pg', discard the next digits, store extension) Replace \1<whatever inserts counter>\2 so if ? is a number counter char \1???\2 (or depending on regex you'd need $ instead of \ for group replacement. Last edited by Perkin; 02-02-2013 at 09:57 AM. |
02-02-2013, 04:49 PM | #189 |
Guru
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
|
Perkin,
Thanks for understanding what I'm doing despite me leaving the extract/fix/repack process unmentioned. I did however leave you with a bad example - that was the output, not the input. The thing is, I cannot use "pg" as that is something I am adding. Basically the input files are variously named but with numbers at the end. So a more realistic input page might be: Terminator 2 23.jpg that I want to rename into: Terminator 2 -- ch14 pg023.jpg There are other naming issues, but I've managed to handle them. Perhaps not optimally, but they get the job done. I just can't seem to isolate the numbers at the end of the filename and strip them. To the best of my knowledge my bulk renamer is using python flavored regex. I haven't tried you code yet, but I will. |
02-02-2013, 05:55 PM | #190 |
Groupie
Posts: 171
Karma: 86271
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
|
--edit, not sure if this helps, unfamiliar with 'extract/fix/repack process'
i think you'd need to do a couple of passes to turn 1.jpg into 001.jpg, 11.jpg into 011.jpg, etc. Code:
(.*?\s)(\d)(\.jpg) \100\2\3 and then (.*?\s)(\d{2})(\.jpg) \10\2\3 Last edited by mzmm; 02-02-2013 at 06:01 PM. |
02-03-2013, 08:24 AM | #191 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
@Sabardeyn, can you give a few more (differing?) example filenames - so we can see what's consistent or what isn't, with what you would like them mapped to.
What's the name of your Batch Rename app/script, I can then scan through it's docs and try and see what the correct replace would be. |
02-28-2013, 11:55 AM | #192 | |
Member
Posts: 24
Karma: 10
Join Date: Mar 2011
Location: Colorado
Device: Cruz Tablet
|
Joining Paragraphs when opening and closing quotes are not in same paragraph
Quote:
Thank you Muskrat. This answers my question from 1/13/13 perfectly! Step 1: I go into Calibre and change straight quotes to curley quotes, then Step 2: I open the book in Sigil and use your Regex suggestion and it works perfectly. At first it didn't work then I checked to see if I accidentally copied the blank space after your find expression, and I had. I backed the blank space out and it worked I ♥ brainiacs! |
|
02-28-2013, 01:26 PM | #193 | |
350 Hoarder
Posts: 3,574
Karma: 8281267
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350, Kobo Glo & Glo HD, PW2
|
Quote:
Is there a way to find the reverse situation, to find paragraphs where there is an ending quote but was no starting quote at the beginning of the paragraph? Last edited by Ripplinger; 02-28-2013 at 02:43 PM. |
|
03-04-2013, 04:48 AM | #194 | |
Groupie
Posts: 171
Karma: 86271
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
|
Quote:
Code:
<p[^>]*>(?<!")(\w.+?")</p> |
|
03-04-2013, 06:50 AM | #195 |
350 Hoarder
Posts: 3,574
Karma: 8281267
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350, Kobo Glo & Glo HD, PW2
|
I couldn't get that to work at all and was about to give up and then realized you didn't use the curly smart quotes. Once I changed it to smart quotes, it would work somewhat, but it will also pick up any sentence or paragraph that doesn't immediately start with a quote. So it would pick up paragraphs like this:
Pamela shuddered. “We’ve been making ourselves polite to a murderess.” And there's usually far too many of those types of sentences to want to read through over 500 of them to find the beginning quote buried further in. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Examples of Subgroups | emonti8384 | Lounge | 32 | 02-26-2011 06:00 PM |
Accessories Pen examples | Gunnerp245 | enTourage Archive | 15 | 02-21-2011 03:23 PM |
Stylesheet examples? | Skitzman69 | Sigil | 15 | 09-24-2010 08:24 PM |
Examples | kafkaesque1978 | iRiver Story | 1 | 07-26-2010 03:49 PM |
Looking for examples of typos in eBooks | Tonycole | General Discussions | 1 | 05-05-2010 04:23 AM |