![]() |
#1 |
Member
![]() 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 |
![]() |
![]() |
![]() |
#2 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,889
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#4 |
Member
![]() 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.
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,339
Karma: 8012652
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. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |