01-20-2018, 03:13 PM | #1 |
Enthusiast
Posts: 31
Karma: 48958
Join Date: May 2017
Device: iPad Pro 9.7"
|
Default "find" for Search/Replace regex functions
From what I understand from reading the "Function mode for Search & replace in the Editor" section of the manual, although the search/replace function is saved, the find string isn't. Thus, we have to enter the find string every time we use the saved function. This means we either have to remember them or store them elsewhere, the former being difficult when the strings are complicated, and the latter being unnecessary duplication.
I'd like to request that we be able to specify the default find string for a saved regex function. That way, when we chose a saved function from the dropdown list, it would also fill in the find string with our default. We could change the find string at that point if we wanted to, but at least it's initially populated with the "normal" default. (And, of course, if we didn't want a default, we would just leave that line empty.) Maybe it's just a Code:
default_find = "blahblahblah" Thanks! |
01-20-2018, 09:59 PM | #2 |
creator of calibre
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you want to save a search, use the saved searches feature in the editor. There you can save every aspect of the search, the find string the mode, the replace expression, etc.
|
01-21-2018, 12:05 AM | #3 |
Enthusiast
Posts: 31
Karma: 48958
Join Date: May 2017
Device: iPad Pro 9.7"
|
Ahhh, very good, thanks. I didn't get from the manual that Saved Searches would work for regex functions (Saved Searches doesn't mention regex functions, just regex expressions, and the Regex functions section doesn't mention saved searches).
|
01-21-2018, 01:30 PM | #4 |
Book E d i t o r
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
It's much quicker to place all your search and replace strings in one text file, especially when you have to go through a lot of regex searches. Just copy and paste from the opened text file, instead of messing around with using the Saved Searches. My text file is named "errors.txt," is easy to remember and open, and is easy to copy and paste each search string.
|
01-21-2018, 06:15 PM | #5 | |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
I have a pile of saved searches. When I start "mending" a book, I select most of them, and hit find. Decide if this is an actual problem, and hit find and replace, or find to move on. Repeat until all the problems have been fixed. it isn't quite as simple as that, but a lot quicker than copying the search terms from a text file for 20 or so searches. |
|
01-21-2018, 07:39 PM | #6 | |
The Fumbler
Posts: 66
Karma: 10
Join Date: Jun 2015
Device: android 4.2/fbreader
|
Quote:
I have been using that technique for year and it is very efficient and effective. |
|
01-21-2018, 09:56 PM | #7 |
Book E d i t o r
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
Thank you. When you're a fast typist, as I am, it really is the quickest way to get through the entire list of things I search for. I have Editpad open on the left side of my screen and just go down the list, one at a time, in the order I have all the strings listed in that text file.
|
01-21-2018, 10:51 PM | #8 | |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
- alt-tab to Editpad - select the search text - ctrl-c to copy the search text - alt-tab to calibre - ctrl-f to put the cursor in the find field - ctrl-v to past the search text - alt-tab to Editpad - select the change text - ctrl-c to copy the change text - alt-tab to calibre - tab to get to the change field - ctrl-v to past the change text - press enter to search - press whatever to make the change (don't know what the keyboard shortcut is) - repeat the last two for all occurrences in the file Or use change all if it is safe - repeat all of the above for all of the search/changes is faster than what I described. Even if I do one saved search at a time, all I am doing is selecting the next search in the list and pressing the buttons. And if I added in the number of mistakes I would expect in going through a long list, then doing it manually gets even worse. |
|
01-21-2018, 11:29 PM | #9 |
Book E d i t o r
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
No, I have much faster ways to do what you described than to go through all that you listed. My problem is I do this all so quickly that I have to wait for the software sometimes, even on this very fast computer I built.
Hint: I don't use alt-tab, I don't use tab, I don't use ctrl-f, and I don't use Enter to search. I use one hand on the mouse and the other hand on ctrl-c and ctrl-v, and I use a monitor that's large enough to have each window sized to be able to access each of them with the mouse without the need to use alt-tab or any other method to switch between windows. Trust me. This is much quicker than using Saved Searches, which I used for a short time almost three years ago, until I came up with this much faster method. Last edited by deback; 01-21-2018 at 11:41 PM. |
01-23-2018, 12:22 PM | #10 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Only a open minded thought...
I use S&R with saved searches quite often. Something that you will never make as fast as with saved searches is block changes in a chain. But this isn't the point. I believe that you are capable to do fast copy & past actions, but I didn't see often people who was really fast with keyboards; not to say that the majority of users still won't have the capability to do this in the way you do it. So why should your experience work better for all? More a rhetorical question It could have maybe also to do with a good setup for a workspace - having tools on a place where you need them and not clicking around within menu's. I often see people exactly doing this instead of taking a bit more time for thinking and then modifying the workplace in the way they need it. I was quite happy when Kovid starts his work for the calibre editor and took as well a closer look to Sigil. He implement some of Sigil's good concepts as they was good and well developed from users who work with this tools on a day to day business. Saved searches is surely one of this. An other good concept was the flexible windows where a user is able to configure a workplace as he need it for his specific work. For me it often looks like a lot of people don't know to use the capabilities of both programs. I won't say that there is no space for additional little improvements, but the way it works now is (for me) way better than doing copy and past for S&R, es because what is with the rest of setup a search, combining searches for complex activities? |
01-25-2018, 10:50 PM | #11 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
I have been using the "saved searches" tool for quite a long time and enjoy every feature of it. - You can call a group of searches by a code word on the top line - You can execute a group search (select with Shift) - You can have a detailed report of every regex of this group (before="count" or after). ... |
01-31-2018, 06:21 AM | #12 | |
Groupie
Posts: 167
Karma: 158116
Join Date: Oct 2015
Device: Kobo Glo HD (landscape), Kobo Aura One
|
Quote:
I am not editing my books. I only update meta data always the same way. Is there something similar to «saved search tool» possible for «bulk metadata edit dialog». I am looking to run my saved metadata search&replace as a group for several books in one go. |
|
01-31-2018, 11:45 AM | #13 | |
Well trained by Cats
Posts: 29,818
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Yes. Look to the right. You get to basically save the filled form The first Item in the form is the 'recover previously saved' |
|
02-01-2018, 02:20 PM | #14 |
Book E d i t o r
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
|
02-02-2018, 10:41 AM | #15 | ||
Enthusiast
Posts: 31
Karma: 48958
Join Date: May 2017
Device: iPad Pro 9.7"
|
Quote:
Quote:
You also missed, or ignored, that I asked about function mode. Which means I was already writing a Python function to do the replace work, which means a separate text list would be redundant and unnecessary. If I had a list of things that needed to be done, I would put the entire list in the function. The whole rest of this thread after my reply to Kovid was pretty funny. I asked a very specific question, got a very specific answer, and then a fight (used metaphorically and tongue-in-cheek, not literally) breaks out about the whole concept of saved searches. The interweb is an amazing, and amusing, place. |
||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Search and Replace; delete "author" name from "serie" | roosten | Library Management | 6 | 12-17-2015 11:38 AM |
Choice lists for "Search" and "Replace" | korben | Editor | 7 | 07-18-2014 04:03 PM |
Regex or other method to find split quotations "" | CyanBC | Sigil | 9 | 05-14-2013 02:52 PM |
MS Word Find & Replace and "Smart" quotes question. | Ahu Lee | Workshop | 1 | 01-14-2013 11:02 AM |
timefmt, align="center", find replace | Kirk Vomit | Recipes | 0 | 04-11-2012 05:03 AM |