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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-27-2011, 07:27 PM   #1
Zifnab
Member
Zifnab began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Mar 2011
Device: Aluratek
Appending from one field to another

Hi,
Still struggling with regex. I have a large number of entries that are from the same author and series but are entered into calibre as follows:
Title: Author author - The Series - ###
Author field: Book title
What I would like to do is copy the book title out of the author field and put it after a : and space at the end of the title field. After that, fixing putting the author into the author field is a piece of cake.
I know I can do a search in the author field for (.*?) to get the full title, but I cannot figure out how to append it to the title field so that it is entered like this:
Author author - The Series - ###: title
Can anyone give me the regex expression to do this? I don't care about clearing out the author field, I just want to copy it to the end of the title field.
Thanks.
Zifnab
Zifnab is offline   Reply With Quote
Old 04-28-2011, 12:46 AM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,908
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
I don't have the expertise to answer this question, but it would be best to learn the regex needed in preferences - Adding books so your books are imported correctly in the first place.
DoctorOhh is offline   Reply With Quote
Old 04-28-2011, 05:09 AM   #3
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
You'll need to use what is called backreferences. Basically, for getting the title from the author field to the title field, search for (.*) in the author field and replace with \1 in the title field. There's a chapter on backreferences in the tutorial.
An easier way to do what you want would be to use bulk metadata edit to swap author and title and then go from there.
Manichean is offline   Reply With Quote
Old 04-28-2011, 07:50 AM   #4
Zifnab
Member
Zifnab began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Mar 2011
Device: Aluratek
I understand back references and taking the author field and moving it to the title field is fairly simple using \1. But I would like to leave the contents of the title field intact, adding colon space at the end, then putting in the contents of the author field. I have looked at the documentation, but unless I missed it I did not see anything about adding other things and appending to the end of a field.
Zifnab is offline   Reply With Quote
Old 04-28-2011, 09:21 AM   #5
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Check the mode field to the right of the destination field.
Manichean is offline   Reply With Quote
Old 04-28-2011, 09:32 AM   #6
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,893
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Are you using bulk metadata edit search/replace? If so, you haven't noticed the Mode box, which gives the options of replace, prepend, and append.

See the attached screenshot. Fields of interest are indicated with a red arrow.
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.png
Views:	80
Size:	49.3 KB
ID:	70591  
chaley is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Metadata Field gpp Sigil 6 02-22-2011 09:39 AM
Comments field emeybee Calibre 1 05-27-2010 03:01 PM
Comments field banjomike Calibre 7 04-08-2010 03:18 PM
A Field of Darkness - $2.99 on Kindle koland Deals, Freebies, and Resources (No Self-Promotion) 0 11-06-2009 01:34 AM
Comments field hyperact Calibre 3 12-28-2008 02:38 PM


All times are GMT -4. The time now is 07:31 AM.


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