Tushar Gandhi wrote:
I am doing a finctionality to import csv file.
My CSV file is like this
Data-- Tushar, sangavi,pune, I am a ror developer
My controller code is:-
@parsed_file.each do |row|
My problem is if you looked at it that address is "sangavi,pune". But
whenever I am printing the row values. I am getting row as "sangavi"
and row as "pune", which is not correct, Can anyoneone tell me how
should I solve this problem?
The data is being parsed correctly, it's the data format that is
For sanity's sake, strings should always be delimited by double-quotes
in CSV, as in:
"Tushar","sangavi, pune","I am a ror developer"
Tushar, sangavi, pune, I am a ror developer
has 4 elements which are comma separated. Given that one of your fields
is 'details', what happens if the data is:
Tushar, sangavi, pune, I am a ror developer, and I like curry, cricket,
and Bollywood movies.
Enclose those strings in quotes.