def run(dir)
      FileUtils.mkdir_p(dir) unless File.directory?(dir)

      each_list do |number, data|
        #puts number
        file = number.to_s.rjust(3, "0") + ".tsv"
        path = File.join(dir, file)
        File.open(path, "w") { |f| f.write data}
      end
    end
def run(dir)
      FileUtils.mkdir_p(dir) unless File.directory?(dir)

      each_list do |number, data|
        #puts number
        file = number.to_s.rjust(3, "0") + ".tsv"
        path = File.join(dir, file)
        File.open(path, "w") { |f| f.write data}
      end
    end
Creates a new extractor. Expects the path to a copy of the code lists
 file from the spec (called ONIX_BookProduct_CodeLists.xsd on my system).

 generate a set of TSV files in the given directory. Creates the directory
 if it doesn't exist and will overwrite existing files.