I'm using bash shell. I want to parse a CSV file, in which the CSV file observes true CSV formats. From this thread -- https://stackoverflow.com/questions/4286469/how-to-parse-a-csv-file-in-bash , I got this
#!/bin/bash file_path=$1 echo $1 while IFS=, read -r ID name address zipcode do echo "I got:$ID|$name|$address|$zipcode" done < $file_path
However, in a CSV file, since some cells might themselves contain a comma, there are quotes around those items. So the below file doesn't parse properly
1,1871,"222 W. Merchandise Mart Plaza, Suite 1212",60605
Is there a way to modify the above script (or produce a new one) in which a CSV file can be accurately parsed?