Skip to content

Instantly share code, notes, and snippets.

@sipadan2003
Created December 9, 2019 07:47
Show Gist options
  • Save sipadan2003/cfb88975985647ec8d35d105850e2e6c to your computer and use it in GitHub Desktop.
Save sipadan2003/cfb88975985647ec8d35d105850e2e6c to your computer and use it in GitHub Desktop.
#!/bin/bash
function goCsv {
local IFS=,
while read row; do
local output=
columns=($row)
for c in "${columns[@]}"; do
if [ "${c}" == "" ]; then
c="AAA"
fi
if [ "${output}" == "" ]; then
output="${c}"
else
output="${output},${c}"
fi
done
echo "${output}"
done < data.csv
}
goCsv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment