问题
I have a json file with the following contents
{"STATUS":"PASS","PASSRATE":96.95238}
I want to store the passrate so that I can use it to append to a filename.
回答1:
Check jsonextractor.bat with which you can extract information from json file by given dot notated path to object:
jsonextractor.bat data.json PASSRATE
回答2:
You could use Xidel for that:
xidel -s data.json -e "$json/PASSRATE"
来源:https://stackoverflow.com/questions/47048992/parse-and-store-text-from-a-json-file-in-windows-batch-script