Alter file name and JSON structure in transfer-data.sh
This commit is contained in:
		@@ -5,13 +5,15 @@ TTD="10"
 | 
				
			|||||||
KEY="ZGVmaW5tYUB0MzhiYmNjZDE2MjE3NDViODgxMTk5ZGI2ZWQzZGFiNmE6RGVGaW5NYWNoZW4yMDIwIQ=="
 | 
					KEY="ZGVmaW5tYUB0MzhiYmNjZDE2MjE3NDViODgxMTk5ZGI2ZWQzZGFiNmE6RGVGaW5NYWNoZW4yMDIwIQ=="
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Build name
 | 
					# Build name
 | 
				
			||||||
NAME=${1##*/}
 | 
					# Basename of file with the last dot replaced by a slash and .DPT extension
 | 
				
			||||||
 | 
					NAME=$(basename $1)
 | 
				
			||||||
 | 
					NAME="${NAME%.*}_${NAME##*.}.DPT"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Build body
 | 
					# Build body
 | 
				
			||||||
JSON="{\"$NAME\": ["
 | 
					JSON="{\"filename\":\"$NAME\",\"dpt\":["
 | 
				
			||||||
while read LINE
 | 
					while read LINE
 | 
				
			||||||
do
 | 
					do
 | 
				
			||||||
	JSON+="[${LINE%,*}, ${LINE#*,}], "
 | 
						JSON+="[\"${LINE%,*}\",\"${LINE#*,}\"], "
 | 
				
			||||||
done < $1
 | 
					done < $1
 | 
				
			||||||
JSON=${JSON::-2}
 | 
					JSON=${JSON::-2}
 | 
				
			||||||
JSON+=']}'
 | 
					JSON+=']}'
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user