fix(bin): adjust dload.sh for file management
This commit is contained in:
parent
bcf523b0dc
commit
0339153847
14
bin/dload.sh
14
bin/dload.sh
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue