Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #for file in Kammer*.csv
- #do
- filename=$(basename -- "$1")
- echo ${filename}
- extension="${filename##*.}"
- filename="${filename%.*}"
- A=$(echo $filename | cut -f2 -d'_')
- B=$(echo $filename | cut -f3 -d'_')
- G="${A},${B},"
- while read line
- do
- U=$(echo $line | sed -E 's,([0-9]{2})\.([0-9]{2})\.([0-9]{4}),\3-\2-\1,g')
- X=$(echo $U | sed -E 's,([0-9]{4})/([0-9]{2})/([0-9]{2}),\1-\2-\3,g')
- Y=$(echo $X | sed -E 's,([0-9]{2})/([0-9]{2})/([0-9]{4}),\3-\2-\1,g')
- Z=$(echo $Y | cut -d',' -f1-2,9,13-15,20,23-27)
- #R=$(echo $Z | cut -f1 -d ',')
- #U=$(echo $R | cut -f3 -d','| awk '{print $4}'| cut -d ':' -f2)
- ##Y=$(echo $X | cut -f2 -d'_')
- echo "${G}${Z}" >> $G.csvdata
- OLDC=${C}
- OLDD=${D}
- done < "$1"
- #done
- #mv /tmp/courbestest.csv /home/phil/Schreibtisch/courbestest.csv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement