sorting numerically

Any trouble you encounter with the Pedias, here's the place to ask for help.
Post Reply
tatlin
Junior Member
Junior Member
Posts: 4
Joined: Mon Dec 12, 2005 4:21 pm
Location: Vancouver, BC

sorting numerically

Post by tatlin »

I have a client who is using CDpedia to index a large collection of recordings (about 2200 at last count). He had the info in an Appleworks database which was causing a lot of problems, and since we imported his index into CDpedia things have been going very well.

The only problem stems from sorting by number. He had his own numbering system, and we imported the numbers into CDPedia. However, when we sort the list on the "number" field, the numbers are arranged alphabetically (1,10,100,11,12, ...) rather than numerically (1,2,3, ...).

Is there an easy fix that will allow us to sort this field numerically?
User avatar
Nora
Site Admin
Posts: 2155
Joined: Sun Jul 04, 2004 5:03 am
Contact:

Post by Nora »

Which field are you using for the numbers? The Collection ID field should automatically sort numerically.
tatlin
Junior Member
Junior Member
Posts: 4
Joined: Mon Dec 12, 2005 4:21 pm
Location: Vancouver, BC

Post by tatlin »

We imported the numbers as a custom field.

So, next question: what is the easiest way to get all of the info out of the custom field and into CollectionID? Will we have to export the library and thenre-import, or is there some faster method?
User avatar
Nora
Site Admin
Posts: 2155
Joined: Sun Jul 04, 2004 5:03 am
Contact:

Post by Nora »

Try holding down the option button before sorting the column. If it's already sorted, click on another column header and back to the Custom column with the option button held down. Does that change the sort to numerical? If not, here's how you can get the numbers over to Collection ID.

If you haven't used the Collection ID field, i.e. they are all blank, then you don't have to do a whole export/import (which would make you loose the covers). Just to make sure that they really are all blank, select all entries and choose Edit to bring up a multiple edit window. Then check the box next to the Collection ID field and hit OK. That'll blank out any remaining Collection ID fields. Now go into the Help menu and choose 'Rebuild database'. That will remove the blank Collection ID fields from your info.xml file. Quit CDpedia and to be on the safe side, do a backup of your info.xml file, by default found in ~Library/Application Support/CDpedia/info.xml Then open the info.xml file with any good text editor and do a find for >CustomOne< (or >CustomTwo<, depending on which one you're using) and replace for >Collection<. (A program like BBEdit will do this in one step for you, very handy..) Save the file and when you restart CDpedia all the numbers will have migrated from the Custom field to Collection ID.
tatlin
Junior Member
Junior Member
Posts: 4
Joined: Mon Dec 12, 2005 4:21 pm
Location: Vancouver, BC

Post by tatlin »

Actually, we tried re-importing the entire data set, this time with the number field imported into Collection ID. It still sorts alphabetically rather than numerically.

The numbers include some with decimals (to indicate related recordings in a series) -- might that have something to do with it? Or can you think of other reasons why this might be occurring?
tatlin
Junior Member
Junior Member
Posts: 4
Joined: Mon Dec 12, 2005 4:21 pm
Location: Vancouver, BC

Post by tatlin »

Posted my most recent reply before reading your suggestions re option key, etc. I'll let you know how it works out.
Post Reply