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 02-01-2015, 01:42 PM   #1
Smokva
Member
Smokva began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Feb 2015
Device: none
Duplicate/Copy column

Is there a way to duplicate or copy a non-user defined column?
I have a large library and my TAG columns are a real mess. I would like to clean them up but it will take a while. In the mean time, I don't want to delete the existing tags as they would be useful in until the update is complete,
My first thought was to create a user-defined column called 'My Tags' and use it to represent the new organized tags. However, what I really want is the original TAG column to have the updated tags. So if I do this, I have to find a way to copy/overwrite the data in 'My Tags' into the original 'Tags' once its complete. I have no idea how to do that.
My second thought was to duplicate the original TAGS column, and then simply erase the data in the original TAG column and add the new tags directly using the copied column as reference. When I am finished, I would simply delete the other column. However, I have no idea how to duplicate the column.

Any advice would be appreciated.
(Note: Please don't say just to use the new column 'My Tags'. I know that is an option, but if I export or transfer books, the other user would have to have that column in order for the data to transfer. Everyone automatically has the TAG column, so that is why I want that original column to have the updated data.

Thanks in advance!
Smokva is offline   Reply With Quote
Old 02-01-2015, 02:31 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Select all books you want to affect, hit Edit Metadata. Now, in Bulk Edit Metadata, use the third tab (Search and Replace) to search the tags column and replace into the #custom_mytags column.

You will need the following settings:

Search Mode: Regular Expression
Search Field: tags
Search for: (.*)
Replace with: \1
Destination Field: #custom_mytags


This will copy the contents of the tags column for all books, into the new column. Once they are cleaned, you can simply repeat the same S&R, but switch the Search and Destination fields around, to copy in the other direction.


Do remember though -- when doing bulk changes, be careful not to jump the gun! There is NO going back, unless you have backed up your library!
You can seriously mess up your library and delete things permanently if you are not careful.
/end boilerplate warning

Last edited by eschwartz; 02-01-2015 at 02:35 PM.
eschwartz is offline   Reply With Quote
Old 02-01-2015, 05:03 PM   #3
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,749
Karma: 27405072
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Smokva View Post
Is there a way to duplicate or copy a non-user defined column?
I have a large library and my TAG columns are a real mess. I would like to clean them up but it will take a while...
@Smokva - and/or you might want to have a look at this plugin ==>> QuarantineAndScrub. I believe it's purpose is to take the burden out of cleaning up metadata such tags.

BR
BetterRed is offline   Reply With Quote
Old 02-01-2015, 08:25 PM   #4
Smokva
Member
Smokva began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Feb 2015
Device: none
@eschwarts: Thank you very much. This worked great. Between the backup and the copying, it took some time (like I said... lots of books ) but it duplicated well, and I am able to delete sections of the original TAG column without it affecting the MY TAGS column. Just what I was looking for. I assume (.*) and \1 are variations of 'copy all' and 'paste all' respectively.
And thank you for making your instructions idiot proof. I appreciate that you did not say "Just use search and replace!"

@Better Red: Thanks for the suggestion. I actually did look at that plug-in before posting but it seemed that there were too many possible pitfalls for me to use it successfully at my current level of expertise (or lack thereof). Even the programmer warned against it ... and being a firm believer in Murphy's Law.... well, need I say more?
I mean, I am still trying to figure out what the heck "Library Metadata Backup Status" in Library maintenance refers to. (Its obviously not a back-up bc that is done by copying the file through Explorer, so what the heck does it do?)
But at some point in the future, I will experiment with it and/or other plug-ins. There are some good ideas there. At this point though, I just want to get the job done.
Thanks again to both of you for the quick response.
Smokva is offline   Reply With Quote
Old 02-01-2015, 08:37 PM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by Smokva View Post
@eschwarts: Thank you very much. This worked great. Between the backup and the copying, it took some time (like I said... lots of books ) but it duplicated well, and I am able to delete sections of the original TAG column without it affecting the MY TAGS column. Just what I was looking for. I assume (.*) and \1 are variations of 'copy all' and 'paste all' respectively.
And thank you for making your instructions idiot proof. I appreciate that you did not say "Just use search and replace!"
You're welcome. And yes, they are the Regular Expressions way of saying "capture all" and "replace all".
(Follow that link if you are interested in reading the calibre manual page on Regular Expressions. Useful tool, although of course not obligatory. )

Quote:
@Better Red: Thanks for the suggestion. I actually did look at that plug-in before posting but it seemed that there were too many possible pitfalls for me to use it successfully at my current level of expertise (or lack thereof). Even the programmer warned against it ... and being a firm believer in Murphy's Law.... well, need I say more?
I mean, I am still trying to figure out what the heck "Library Metadata Backup Status" in Library maintenance refers to. (Its obviously not a back-up bc that is done by copying the file through Explorer, so what the heck does it do?)
But at some point in the future, I will experiment with it and/or other plug-ins. There are some good ideas there. At this point though, I just want to get the job done.
Thanks again to both of you for the quick response.
Well, I can't help you with that plugin (it confused my cursory inspection as well) but regarding the backup status, that refers to the backup metadata.opf files in each ebook folder. They contain plaintext structured references to all the metadata about each book. You can ignore them, unless the database tragically corrupts itself someday, and you need to use the Restore Database feature.
And even then, you just click the button and calibre worries about the .opf files.
eschwartz is offline   Reply With Quote
Old 02-01-2015, 08:50 PM   #6
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,749
Karma: 27405072
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@Smokva - no worries,

Some metadata updates cascade through many books - eg if you changed a Publisher name from Random Hose, to Random House then all the books with Random Hose would have their metadata updated. In the book folders you'll see there are metadata.opf files, the sole purpose of which is to backup the metadata, for use by the Restore database function. The metadata.opf files are not written immediately something changes, they are written in a background task at about 1/second - so if you had 1,000 Random Hose books it would take about 15 minutes to write the 1,000 updated metadata.opf files with Random House.

The "Library Metadata Backup Status" tells you how how many metadata.opf files are still waiting to be written. Don't worry... if you close calibre, it will carry on rewriting them when calibre is started again. If you want to get it done quickly, use the calibredb backup_metadata command. I did something the other day that would have taken more than 2 hours to write the new files, it took about two minutes from the command line - the reason I did it is that the disk ticking annoys me.

BR

Last edited by BetterRed; 02-01-2015 at 08:54 PM.
BetterRed is offline   Reply With Quote
Old 09-17-2022, 06:22 PM   #7
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,161
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by eschwartz View Post
Select all books you want to affect, hit Edit Metadata. Now, in Bulk Edit Metadata, use the third tab (Search and Replace) to search the tags column and replace into the #custom_mytags column.

You will need the following settings:

Search Mode: Regular Expression
Search Field: tags
Search for: (.*)
Replace with: \1
Destination Field: #custom_mytags
Thanks for sharing how you did this! My method was too slow.
Amalthia is offline   Reply With Quote
Old 06-27-2024, 12:35 PM   #8
Ealdwulf
Member
Ealdwulf began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Jun 2012
Device: Nook
Quote:
Originally Posted by eschwartz View Post
You will need the following settings:

Search Mode: Regular Expression
Search Field: tags
Search for: (.*)
Replace with: \1
Destination Field: #custom_mytags
Bit of a necro here, but this was exactly what I needed to replace the tags on my books with what I have identified by a Genre column.

Thank You!
Ealdwulf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to "copy" or combine tags in two columns not as a built column? jecilop Library Management 7 09-04-2014 07:26 PM
Can I make a duplicate copy of my Calibre Library Chuck Reid Library Management 7 08-23-2014 11:00 AM
Copy Custom Column to another library gabby98 Calibre 10 01-26-2014 10:59 PM
Copy data from one column to another Wyndham Library Management 3 11-19-2013 01:14 PM
Column copy (one time) wsignal Library Management 6 05-08-2013 04:41 PM


All times are GMT -4. The time now is 02:27 PM.


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