marc2csv: a most helpful tool

The situation:  we had a large batch of raw MARC21 records we wanted to remove from Millennium; however, the records contained descriptive metadata for items in the archives that we wanted to save for reuse.  Enter Matt McCollow’s ultra-handy marc2csv script.

I only made some small changes to the script, mostly because I didn’t need to work on multiple files (this was just a big one-file dump, labelled “export.dat”; not sure if it came from Millennium or OCLC Connexion) and wanted to extract metadata from different fields than coded by default.

Fortunately, McCollow’s script is very clearly written and a snap to use.  I chopped a few lines of code and edited the fields to match the information I was interested in, and voila! A CSV populated by all the relevant metadata, ready to tuck away for further processing.

I’m not going to repost my version here, because it is so similar to the original — install Ed Summers’ great pymarc library and then go see McCollow’s GitHub and get your MARC processing on!