def write_analyzed(dir)
      FileUtils.mkdir_p(dir)

      attributes.each do |a, v|
        path = File.join(dir, a.to_s)
        s = "Count|Value\n" + v.map { |e| "#{e[:count]}|#{e[:value]}" }.join("\n")
        File.open("#{path}.csv", 'w') { |f| f.write(s) }
      end
    end
def write_analyzed(dir)
      FileUtils.mkdir_p(dir)

      attributes.each do |a, v|
        path = File.join(dir, a.to_s)
        s = "Count|Value\n" + v.map { |e| "#{e[:count]}|#{e[:value]}" }.join("\n")
        File.open("#{path}.csv", 'w') { |f| f.write(s) }
      end
    end
Writing multiple files to given dir.