View Single Post
Old 11-11-2012, 06:04 PM   #2
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,212
Karma: 5495470
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by minorum View Post
Hi,

I need some help with regular expression and Bulk Metadate editing.
I am no programmer and have only read the calibre help for regular expressions.

I have created a new collum "genre". Now I want to search in "tags" for a given string like "crim" and if it is found the according genre in this case "Krimi" should be written in the "genre" collum.

I managed to make an regex that finds the word:
\.*crim\.*

I enterd "Krimi" in the exchange field. But what happens now is that the whole contents of the "tags" collum is copied to the new collum and only the letters "crim" are replaced bei "Krimi". But what I want is only the word Krimi in the genre collum and nothing else.

I am quite sure that it can be done. So could anyone help me and write down how this expression should look like?

many thanks

minorum
slash dot star

slash dot says look for a dot

try
.*(\,crim)\,.*
and your term in the replace field with the destination set as #genere (all custom column names start with a # )

since this original is a Tag, KISS use the Tag editor (the little recycle button on the FAR Left of the Metadata editor. Using this, removes ALL (every book) usage of the selected tag
theducks is offline   Reply With Quote