Below is the script I'm using
#!/bin/bash
export IFS=","
cat ddd.csv
I need to get the contents of ddd.csv as an array. I also need to convert that array in the form of a table with headers.
Please help,I'm really new to unix shell.
Below is the script I'm using
#!/bin/bash
export IFS=","
cat ddd.csv
I need to get the contents of ddd.csv as an array. I also need to convert that array in the form of a table with headers.
Please help,I'm really new to unix shell.
This page shows some tricks on how to extract CSV data in bash as below:
#!/bin/bash
while IFS="," read f1 f2 f3
do
echo $f1 $f2 $f3
done < ddd.csv
This should give you a table like output. Alternatively you can put the fields into an array or do whatever you like with them.