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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -