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

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -