3

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.

2 Answers 2

5

Check jsonextractor.bat with which you can extract information from json file by given dot notated path to object:

jsonextractor.bat data.json PASSRATE
Sign up to request clarification or add additional context in comments.

2 Comments

Smooth! Thanks! You are making a html out of it and parsing using javascript I suppose.
@RakeshHorkeri - it is only jscript and html activex object which allows me to use ecmascript6 methods.
0

You could use the JSON-parser for that:

xidel -s "data.json" -e "$json/PASSRATE"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.