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"
|
echo "csvFile: $csvFile"
|
||||||
csvFileNoExt="${csvFile%.*}"
|
csvFileNoExt="${csvFile%.*}"
|
||||||
echo "csvFileNoExt: $csvFileNoExt"
|
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"
|
echo "csvFileLower: $csvFileLower"
|
||||||
csvFileLowerPath=${unzipDir}/$csvFileLower
|
csvFileLowerPath=${unzipDir}/$csvFileLower
|
||||||
echo "csvFileLowerPath: $csvFileLowerPath"
|
echo "csvFileLowerPath: $csvFileLowerPath"
|
||||||
sed '1s/\(.*\)/\L\1/' $csvFilePath > $csvFileLowerPath
|
sed '1s/\(.*\)/\L\1/' $csvFileDotPath > $csvFileLowerPath
|
||||||
#TODO rm $csvFilePath
|
rm $csvFileDotPath
|
||||||
#
|
#
|
||||||
csvFileComma=${csvFileNoExt}-dot-lower-comma.csv
|
csvFileComma=${csvFileNoExt}-dot-lower-comma.csv
|
||||||
echo "csvFileComma: $csvFileComma"
|
echo "csvFileComma: $csvFileComma"
|
||||||
csvFileCommaPath=${unzipDir}/$csvFileComma
|
csvFileCommaPath=${unzipDir}/$csvFileComma
|
||||||
echo "csvFileCommaPath: $csvFileCommaPath"
|
echo "csvFileCommaPath: $csvFileCommaPath"
|
||||||
sed -E 's/(");(")/\1\,\2/g' $csvFileLowerPath > $csvFileCommaPath
|
sed -E 's/(");(")/\1\,\2/g' $csvFileLowerPath > $csvFileCommaPath
|
||||||
#TODO rm $csvFileLowerPath
|
rm $csvFileLowerPath
|
||||||
#
|
#
|
||||||
ZHV_CSV_OUTPUT="$3"
|
ZHV_CSV_OUTPUT="$3"
|
||||||
echo "ZHV_CSV_OUTPUT: $ZHV_CSV_OUTPUT"
|
echo "ZHV_CSV_OUTPUT: $ZHV_CSV_OUTPUT"
|
||||||
|
|
Loading…
Reference in New Issue