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, 06: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-27-2011, 11:46 PM   #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: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, 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
Advert
Old 04-28-2011, 04:09 AM   #3
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
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, 06: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, 08:21 AM   #5
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
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
Advert
Old 04-28-2011, 08:32 AM   #6
chaley
Grand Sorcerer
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: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
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:	300
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 08:39 AM
Comments field emeybee Calibre 1 05-27-2010 02:01 PM
Comments field banjomike Calibre 7 04-08-2010 02:18 PM
A Field of Darkness - $2.99 on Kindle koland Deals and Resources (No Self-Promotion or Affiliate Links) 0 11-06-2009 12:34 AM
Comments field hyperact Calibre 3 12-28-2008 01:38 PM


All times are GMT -4. The time now is 11:34 AM.


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