fix(bin): adjust dload.sh for file management

This commit is contained in:
dancingCycle 2023-08-28 14:30:29 +02:00
parent bcf523b0dc
commit 0339153847
1 changed files with 10 additions and 4 deletions

View File

@ -35,20 +35,26 @@ csvFile=$(basename $csvFilePath)
echo "csvFile: $csvFile"
csvFileNoExt="${csvFile%.*}"
echo "csvFileNoExt: $csvFileNoExt"
csvFileDot=${csvFileNoExt}-dot.csv
echo "csvFileDot: $csvFileDot"
csvFileDotPath=${unzipDir}/$csvFileDot
echo "csvFileDotPath: $csvFileDotPath"
sed 's/\([[:digit:]]\)\,\([[:digit:]]\)/\1.\2/g' $csvFilePath > $csvFileDotPath
rm $csvFilePath
#
csvFileLower=${csvFileNoExt}-lower.csv
csvFileLower=${csvFileNoExt}-dot-lower.csv
echo "csvFileLower: $csvFileLower"
csvFileLowerPath=${unzipDir}/$csvFileLower
echo "csvFileLowerPath: $csvFileLowerPath"
sed '1s/\(.*\)/\L\1/' $csvFilePath > $csvFileLowerPath
#TODO rm $csvFilePath
sed '1s/\(.*\)/\L\1/' $csvFileDotPath > $csvFileLowerPath
rm $csvFileDotPath
#
csvFileComma=${csvFileNoExt}-dot-lower-comma.csv
echo "csvFileComma: $csvFileComma"
csvFileCommaPath=${unzipDir}/$csvFileComma
echo "csvFileCommaPath: $csvFileCommaPath"
sed -E 's/(");(")/\1\,\2/g' $csvFileLowerPath > $csvFileCommaPath
#TODO rm $csvFileLowerPath
rm $csvFileLowerPath
#
ZHV_CSV_OUTPUT="$3"
echo "ZHV_CSV_OUTPUT: $ZHV_CSV_OUTPUT"