Created
December 9, 2019 07:47
-
-
Save sipadan2003/cfb88975985647ec8d35d105850e2e6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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