01-27-2011, 10:00 AM | #1 |
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Increase search and replace?
I've noticed a lot of people using the new search and replace. I've also seen a lot of answers to questions being, "you can do this using search and replace."
Is 3 s&r fields enough or should I add more? Also, are there other changes to it you would like to see? |
01-27-2011, 10:38 AM | #2 |
creator of calibre
Posts: 43,926
Karma: 22669820
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Given that you can chain regexes with | I don't really see the need for more.
|
01-27-2011, 05:12 PM | #3 |
Junior Member
Posts: 4
Karma: 10
Join Date: Jan 2011
Device: kindle 3
|
hello user_none, with search & replace is now possible to have more control over text.
I strongly suggest to add more because three is not sufficient in some cases. It 's true that can be chained with | but you can't do the same with the replace regexp! Also, there is a bug in the regexp (maybe only in preview?): you can't use Start of string and end of string Anchors (http://www.regular-expressions.info/anchors.html) would be nice, in the near future, have more control over text by working directly on the HTML file produced by converted PDF (like Mobipocket Creator). Is it possible? thanks and congratulations. |
01-27-2011, 05:46 PM | #4 | ||
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Quote:
Quote:
|
||
01-27-2011, 06:03 PM | #5 |
creator of calibre
Posts: 43,926
Karma: 22669820
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yeah but if you're doing large scale search replace you should really be using an editor.
|
01-27-2011, 06:18 PM | #6 | |
Junior Member
Posts: 4
Karma: 10
Join Date: Jan 2011
Device: kindle 3
|
Quote:
Code:
(?m)^ Please add more S&R items! at least 5 or 6, or dynamic list. It 's too good! if I have a pdf file, the only way to work on text in html is S & R, I think. Last edited by duepixel; 01-27-2011 at 06:27 PM. |
|
01-28-2011, 03:56 AM | #7 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
|
01-28-2011, 06:51 AM | #8 |
Junior Member
Posts: 4
Karma: 10
Join Date: Jan 2011
Device: kindle 3
|
Do not agree.
For me, more flexible management of S&R is necessary in calibre. There are some situations where the conversion from pdf-> html-> epub lose formatting. example: I have a text like this (converted by calibre pdftohtml engine): __________________________ Code:
a bit 'of sticky stuff. I spent the index and I approached him on the nose. <br> <hr> <A name=39> </ a> tomato sauce. <br> __________________________ Code:
<p class="calibre2"> bit 'of sticky stuff. I Spent the index and I approached HIM on the nose </ p> <p class="calibre2"/> <p class="calibre2"> tomato sauce. </ p> with S&R I can create a regex like this: <br> \ s <hr> \ s <A name=\d+> </ a> and replace wiht nothing. Another example is un-wrapping: Code:
The hottest summer of the century.<br> Four homes lost in the corn. The major are plug-<br> ged into the house. Six children on their bicycles<br> Code:
<p class="calibre2">The hottest summer of the century.
Four homes lost in the corn. The major are plug-ged into the house. Six children on their bicycles</p>
with S&R i can create a regex: ([^\s]\-<br>)|([^\s]\-<br>\s*) and replace with null string. it's wrong? |
01-28-2011, 07:35 AM | #9 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Hyphenated words are de-hyphenated by using your document as a dictionary. However if the word only occurs once in the book the hyphen won't be removed. At a guess, I think the word 'plugged' only occurs a single time in your book.
You can't write a reliable regex to fix that, as you noted with the Mercedes-Benz example - imagine if the line wrapped on Mercede-<linebreak>Benz - you can't delete that hyphen. This sort of thing really is far easier to fix in Sigil. Use Calibre Search and Replace for repeating occurrences throughout the book, use Sigil to clean up the one-off items after conversion. |
01-28-2011, 07:35 AM | #10 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
You need to keep in mind, though, that Calibre is not designed for "working on text", as you say- it's designed to convert and manage books.
That said, I'm a believer in the Zero-One-Infinity rule of software design, as long as the interface isn't too cluttered- so if you can figure out a way to make a potentially unlimited list, that'd be the best solution, if not, I don't think it'll be much difference if we have three fields as opposed to six or however many you'd put in- there'll always be people begging for more. |
01-28-2011, 08:16 AM | #11 | |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
it is much easier to write several simple S& R that to attempt one complex fix-it-in-one . so I'd favour a drop down option to keep adding more, as needed. PS I did not realise that searches could be chained - is that in the instructions ??? Last edited by cybmole; 01-28-2011 at 08:33 AM. |
|
01-28-2011, 09:45 AM | #12 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
|
01-28-2011, 09:58 AM | #13 | |
Junior Member
Posts: 4
Karma: 10
Join Date: Jan 2011
Device: kindle 3
|
Quote:
Until version 0.7.40 I was often forced to use Mobipocket to convert, and then re-import it into calibre for optimization of the text (unwrap, Paragraphs ...) and management (metadata, cover, database, upload on device). With version 0.7.42 (S & R) I left other tools and takes less time to do this. My goal is to read a fairly well-formatted e-book on my kindle 3, I will not waste time rewriting the ebook with Sigil! @ldolse: does not matter if the text contains some little errors not caught by by a regexp. I think this is the goal of most people using calibre! however, I think a solution with a dynamic list for the management of S & R will comes to mind to developers. You can simply add a "Add" button that will display a new pair of fields Search / Replace... Easy. Last edited by duepixel; 01-28-2011 at 10:01 AM. |
|
02-09-2011, 02:58 PM | #14 |
Junior Member
Posts: 3
Karma: 10
Join Date: Feb 2011
Device: sony 600
|
hey
i am also begging for more S & R fields. my PRS600 doesnt properly show all the czech letters so this would be the simpliest way go with (i dont really want to flash my firmware). or is threre any other way how to replace ø ì è ù ï ò with ř ě č ů ď ň not only in pdb books but also in news downloaded from the internet? thanks |
02-09-2011, 03:08 PM | #15 |
creator of calibre
Posts: 43,926
Karma: 22669820
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use the transliterate unicode characters option in the look and feel section under conversion settings.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
macro - Search and Replace | oldbwl | Workshop | 17 | 03-05-2011 01:39 PM |
302 PB 302 increase text darkness and search in library... | fragile | PocketBook | 4 | 01-25-2011 02:00 PM |
need regex help search and replace | schuster | Calibre | 4 | 01-10-2011 09:00 AM |
Search and replace in 0.2.0 | paulpeer | Sigil | 7 | 03-13-2010 11:59 AM |
Why no search and replace? | charleski | Sigil | 10 | 11-24-2009 04:13 PM |