readCSV.sh

#!/bin/bash
IFS=','
output="$1.sql"
while read left right; do
cat>> $outfile << EOF
INSERT INTO sql (left, right) VALUES ($left, $right);
EOF
done < ${1}
lr.csv
left1,right1
left2,right2
left3,right3
left4,right4
left5,right5
>>> ./readCSV.sh