This was part of something else I’d worked on, but it never saw the light of day for a number of (rather silly) reasons. So rather than let these bits go to waste, I created a github repo for posterity. Someone might be able to make effective use of them somewhere.
Repo is located here: https://github.com/joelandman/msd2csv
Pretty simple code, does most of the work in-memory, and multiple regex passes to transform and clean up the CSV.