class Array def to_xls content = '' self.each do |row| row.map! {|col| col = col.to_s.gsub(/(\t|\r\n|\r|\n)/sim, " ").gsub(/ +/, " ") } content << row.join("\t") content << "\n" end content end end