ruby - Can I define more than one column separator with CSV.parse? -
i have weird csv file, has 2 separators: "\t" , ",".
i used parse csv.parse("file", col_sep: "\t")
, have separate fields "," well.
any suggestion how can achieved?
try this:
csv.parse(file.read('csvfile').gsub("\t", ","), col_sep: ',')
Comments
Post a Comment