Copy Column Data?

Any trouble you encounter with the Pedias, here's the place to ask for help.
Post Reply
lousydrummer
Contributor
Contributor
Posts: 6
Joined: Mon Apr 16, 2012 9:51 am

Copy Column Data?

Post by lousydrummer »

Hi,

My guess is that (a) this is fairly easy to do and (b) somewhere, this has been asked and answered, and I just couldn't find it.

Anyhow, I'd like to copy the contents of one column in CDPedia to another column. So, for every entry in the library, I'd like the 'Location' column to match the 'Artist' column. (After which, I'd change a bunch of the 'locations' manually, but the first step is the big batch copy.)

Is that possible?

Thanks, all.
User avatar
Nora
Site Admin
Posts: 2155
Joined: Sun Jul 04, 2004 5:03 am
Contact:

Re: Copy Column Data?

Post by Nora »

There are several threads about moving data from one field to another here on the forum (for example here) but this is the gist:

- Quit CDpedia and make a backup of your database file found in your Home folder under ~/Library/Application Support/CDpedia/Database.cdpd. If you're on Lion, it hides the Library folder by default so to go to your CDpedia data folder you have to use the Finder's 'Go' menu, hold down the Option key and the Library folder will appear.

- Then run the program Terminal found in Applications/Utilities and copy paste the following lines into the window, each followed by a 'return' from your keyboard.

Code: Select all

sqlite3 ~/Library/Application\ Support/CDpedia/Database.cdpd
update zEntry set zlocation = zartist where zlocation is null;
.exit
(This will copy the artist field into the location field for each entry where the location field contains NO information. If there's already something in the location field for an entry it'll leave it as is.)

- Now restart CDpedia and the change will be complete and saved.
Post Reply