I was trying to read a csv
file and split the data by comma.
I used
IFS=, list=($line)
for word in ${list[@]}; do
echo $word
done
to split the csv
record based on comma, which works fine.
The issue is when I have a quoted string in the csv which contains a comma
Name, "Oct 2, 2015 at 1:06 PM", Superman
In this scenario it returns
Name
"Oct 2
2015 at 1:06 PM"
Superman
Whereas I want
Name
"Oct 2, 2015 at 1:06 PM"
Superman
How to solve this?