I am working on a long Bash script. I want to read cells from a CSV file into Bash variables. I can parse the rows and the first column, but not any other column. Here is my code:
cat myfile.csv|while read line do read -d, col1 col2 < <(echo $line) echo "I got:$col1|$col2" done
It prints only the first column. As an additional test, I tried the following:
read -d, xy < <(echo a,b,)
And $ y is empty. So I tried:
read xy < <(echo ab)
And $ y - b . Why?
linux bash csv
User1 Nov 26 '10 at 15:20 2010-11-26 15:20
source share