Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 11-11-2012, 04:57 PM   #1
minorum
Junior Member
minorum began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Dec 2011
Device: Sony PRS-T1, Kobo-Glo
Problems with Bulk Metadata editing

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
minorum is offline   Reply With Quote
Old 11-11-2012, 06:04 PM   #2
theducks
Well trained by Cats
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: 29,785
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:
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
Old 11-12-2012, 02:02 PM   #3
minorum
Junior Member
minorum began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Dec 2011
Device: Sony PRS-T1, Kobo-Glo
Thank you.
Yes the \.* was a mistake.

The expression is was looking for was .*crim.* without the backslash
This worked but for the point that "tags" is a field with mulitble values. So only the value where the string is found will be changed. All others will be copied in the new field.

Is there a way around it?

I dont understand your hint with the tag editor. I don't wont to remove a tag. I just want to use the tags to get my collection into shape by sorting the books to genres like: science fiction, fantasy, etc.
minorum is offline   Reply With Quote
Old 11-12-2012, 04:39 PM   #4
theducks
Well trained by Cats
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: 29,785
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:
Originally Posted by minorum View Post
Thank you.
Yes the \.* was a mistake.

The expression is was looking for was .*crim.* without the backslash
This worked but for the point that "tags" is a field with mulitble values. So only the value where the string is found will be changed. All others will be copied in the new field.

Is there a way around it?

I dont understand your hint with the tag editor. I don't wont to remove a tag. I just want to use the tags to get my collection into shape by sorting the books to genres like: science fiction, fantasy, etc.
I had assumed

then simply use the Tag browser for the selection criteria (remember the any or All choice setting at the bottom).

select All, then use the Bulk metadata edit to add your value to your field.

change the criteria, repeat
theducks is offline   Reply With Quote
Old 11-12-2012, 05:08 PM   #5
minorum
Junior Member
minorum began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Dec 2011
Device: Sony PRS-T1, Kobo-Glo
Thanks again

Now that I read it is quite obvious - I probably was looking for something more complicated
minorum is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
series_index gets reset to [1] using "edit metadata in bulk, basic metadata" Boekenworm Library Management 4 11-25-2013 06:51 PM
Bulk Metadata Editing not working jvik Calibre 5 01-04-2011 09:34 AM
Editing Metadata in Bulk ballast Calibre 5 08-15-2010 03:14 PM
unexpected behavior when bulk editing curantil Calibre 1 06-07-2010 06:45 PM
Editing Metadata in Bulk Question lwpack Calibre 10 07-19-2009 11:40 PM


All times are GMT -4. The time now is 12:16 AM.


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