Skip to content

Instantly share code, notes, and snippets.

@mark-cooper
Created December 22, 2011 18:13
Show Gist options
  • Save mark-cooper/1511270 to your computer and use it in GitHub Desktop.
Save mark-cooper/1511270 to your computer and use it in GitHub Desktop.
Library database maintenance: find circulating titles with acquisition records
require 'marc_tools'
# https://github.com/mark-cooper/marc_tools
# SCL branches (to exclude consortial partner branches)
BRANCHES = [
'cent',
'clov',
'fore',
'guer',
'heal',
'nort',
'occi',
'peta',
'rinc',
'rohn',
'seba',
'sono',
'wind',
'ext',
]
MARC::ForgivingReader.new('records/dvd.mrc').each do |r|
r = MarcTools::MarcRecordWrapper.new(r)
check = false
r.grab('949').each do |item|
check = true if item['a'] != 'r' and BRANCHES.include? item['m']
end
puts r.title if check
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment