Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 07-14-2012, 01:57 PM   #1
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Question Simple Search & Replace not working!?

Hola to all from HOT Mexico!!

Been using Calibre heavily and have started getting more into search & replace using regular expressions. So far have been able to figure out everything except this one! Everything indicates it should work, but it doesn't, so thinking some really noob mistake on settings is the cause but I sure can't figure out what it could be.

I am simply trying to delete the character " &" and everything after it in the Author field. Example: "Name ABC & Name DEF" should read "Name ABC"
Note: This includes one space before the "&".

Easy enough, right? I just use the RE: "\s* & .*" (without the quote marks)

I have saved this RE in the Load Search/Replace section, along with others that work just fine.

When I apply the RE to the Author(s) field, it appears to work, but nothing changes; the contents of the Authors field with the offending "&" are not altered after selecting ALL entries and hitting OK in the Search/Replace window!

So, I use the "Test" field and copy/paste an exact Author field with the "&" in it and it correctly deletes " &" and everything after it, indicating the RE is valid and doing (in test mode) what it is supposed to do!

But, on actual data, nothing happens. I am stumped!

I have played with various other settings, but so far no go.

Its gotta be so obvious it is staring me in the face!

Point me in the right direction!!

Thx - MontyJ

Last edited by MontyJ; 07-14-2012 at 02:08 PM. Reason: Clarify with note
MontyJ is offline   Reply With Quote
Old 07-14-2012, 07:13 PM   #2
MontyJ
Addict
MontyJ began at the beginning.
 
Posts: 224
Karma: 10
Join Date: Jul 2012
Device: Kindle
Quote:
Originally Posted by MontyJ View Post
Hola to all from HOT Mexico!!

Been using Calibre heavily and have started getting more into search & replace using regular expressions. So far have been able to figure out everything except this one! Everything indicates it should work, but it doesn't, so thinking some really noob mistake on settings is the cause but I sure can't figure out what it could be.
.
.
Thx - MontyJ
Ok, talking to myself here, but thought there might be some out there interested in the solution I came up with.

The "&" character is not really a "metacharacter", but Calibre uses it to determine "multiple Authors" when determining a "split". So weird things were happening when trying to do simply things, such as a normal replace of it! Bottom line it won't work because there does not seem to be any way to code (RE) around it!

Anyway, the solution is to use that exact RE I put in the previous post, but then:

- Set the "Search Field" as "Author_Sort", NOT "Author"!!
- Then set the "Destination Field" to "Author"

This will then run the RE normally and the results are what I wanted!

Hope it helps someone...

MontyJ

Last edited by MontyJ; 07-14-2012 at 07:14 PM. Reason: sp
MontyJ is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with a search & replace mmholt Library Management 11 10-21-2011 06:49 PM
Search & Replace :help: krussell Calibre 3 08-02-2011 04:45 PM
Search and replace not working helmerer Conversion 4 02-25-2011 03:48 AM
Using the Search & Replace feature Manichean Conversion 0 01-26-2011 05:26 PM
Search & Replace Pat Nickholds Sigil 2 10-21-2010 11:18 PM


All times are GMT -4. The time now is 03:18 AM.


MobileRead.com is a privately owned, operated and funded community.