Skip to content

Instantly share code, notes, and snippets.

@sunimalr
Last active August 29, 2015 13:57
Show Gist options
  • Save sunimalr/9869078 to your computer and use it in GitHub Desktop.
Save sunimalr/9869078 to your computer and use it in GitHub Desktop.
csvreader_bash
#!/usr/bin/env bash
FILE=parameters.csv
K=1
while read line
do
IFS=, read -a arr <<<"$line"
if [ "$K" != "1" ]
then
echo "var1= ${arr[0]} var2= ${arr[1]} var3= ${arr[2]} var4= ${arr[3]}"
fi
K=$((K + 1))
done < $FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment