I have a weird CSV file, which has two separators: "\t" and ",".
I used to parse with CSV.parse("file", col_sep: "\t")
, but now I have to separate fields with "," as well.
Any suggestion how it can be achieved?
I have a weird CSV file, which has two separators: "\t" and ",".
I used to parse with CSV.parse("file", col_sep: "\t")
, but now I have to separate fields with "," as well.
Any suggestion how it can be achieved?
Try this:
CSV.parse(File.read('csvfile').gsub("\t", ","), col_sep: ',')