def write_single_file(dir, filename = nil)
      FileUtils.mkdir_p File.join(dir)

      # HACKY: NEED TO FIX
      keys = snapshots.first.keys
      keys = snapshots.first[@field].first.keys if @field

      s = []
      s << keys.join(SEPERATOR)
      snapshots.each do |snapshot|
        # HACKY: NEED TO FIX
        if @field
          snapshot[@field].each_with_index do |e, i|
            s << e.values.map do |v|
              if v.is_a?(String)
                "\"#{v}\""
              else
                "#{v}"
              end
            end.join(SEPERATOR)
          end
        else
          s << [*snapshot.values].map { |e|
            e.is_a?(String) ? "\"#{e}\""  : "#{e}"
          } .join(SEPERATOR)
        end
      end

      filename ||= @parser.class.name.split("::").last
      path = File.join(dir, filename)
      File.open("#{path}.csv", 'w') { |f| f.write(s.join("\n")) }
    end
def write_single_file(dir, filename = nil)
      FileUtils.mkdir_p File.join(dir)

      # HACKY: NEED TO FIX
      keys = snapshots.first.keys
      keys = snapshots.first[@field].first.keys if @field

      s = []
      s << keys.join(SEPERATOR)
      snapshots.each do |snapshot|
        # HACKY: NEED TO FIX
        if @field
          snapshot[@field].each_with_index do |e, i|
            s << e.values.map do |v|
              if v.is_a?(String)
                "\"#{v}\""
              else
                "#{v}"
              end
            end.join(SEPERATOR)
          end
        else
          s << [*snapshot.values].map { |e|
            e.is_a?(String) ? "\"#{e}\""  : "#{e}"
          } .join(SEPERATOR)
        end
      end

      filename ||= @parser.class.name.split("::").last
      path = File.join(dir, filename)
      File.open("#{path}.csv", 'w') { |f| f.write(s.join("\n")) }
    end
Write output to a single file. (dir/filename)
 Using parser as filename if none is given.