Print

Print


On 28 August 2015, Rob Dumas wrote:

> Does anyone know of a decent script (preferably Python or Ruby) which will
> break the call number down into an array (or other set) of values (e.g.,
> PN6728.S4546F73 2015 v.2 coll. GRAPHICNOVELS would become ["PN", 6728, "S",
> 4546, "F", 73, 2015, "2", "GRAPHICNOVELS"])? This way, I could have
> granular control over sorting by call number.

I know of two Ruby gems that sort LC for you.  There's one Bill Dueber created 
and I hacked a bit:

    https://github.com/billdueber/lc_callnumber

and then there's this more recent one I saw mentioned on Planet Code4Lib a day 
or two ago:

    https://github.com/pulibrary/lcsort

I haven't tried it and don't know how it relates to the first, but if you want a 
Ruby approach, those should help.

Bill
-- 
William Denton ↔  Toronto, Canada ↔  https://www.miskatonic.org/