Is it possible to ignore or to replace with empty String, when the column is empty? My CSV looks like this:
"DE","Klasse","Deutsch", "x"
"EN","Class","Carpenter",
"DE","Klasse","Mathe",
,,,
So not all the columns are filled. There are several empty columns. It retunrs an error :
TypeError: no implicit conversion of nil into String
What I did is :
csv_contents = CSV.read("path_to_csv", options)
str=["local, type, name"]
csv_contents.each_with_index do |row, i|
if row[3]==nil
str << row[0] + ", " + row[1] + ", " + row[2]
end
end
end I have to modify the csv because all the rows that have "x" in the last column should be deleted. Can anyone help me? Thanks
csv_contents, show that part also..