Convert CSV to array?
Any ideas on how to convert this CSV to a ruby ββarray using vim?
CSV launch:
Year,Make,Model 1997,Ford,E350 2000,Mercury,Cougar
Desired array:
car_info = [
{'Year' => '1997', 'Make' => 'Ford', 'Model' => 'E350'},
{'Year' => '2000', 'Make' => 'Mercury', 'Model' => 'Cougar'},
]
I have> 2000 records like the CSV above and would like it to quickly reformat it for use in my Rails application. I would love to use vim, but I am also open to other options.
+3
source to share