I want a extract a url from a json file and store that into the variable using the batch script.
Below is my json file.
{
"url": "https://api.github.com/repos/octocat/Hello-World/releases/1",
"html_url": "https://github.com/octocat/Hello-World/releases/v1.0.0",
"assets_url": "https://api.github.com/repos/octocat/Hello-World/releases/1/assets",
"upload_url": "https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}",
"tarball_url": "https://api.github.com/repos/octocat/Hello-World/tarball/v1.0.0",
"zipball_url": "https://api.github.com/repos/octocat/Hello-World/zipball/v1.0.0",
"id": 1,
"node_id": "MDc6UmVsZWFzZTE=",
"tag_name": "v1.0.0",
"target_commitish": "master",
}
I want the line between "upload_url" and {?name,label}" stored into the variable. which is
https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets
Can I get the batch script command for achieving this?
I tried the below command:
for /f "tokens=2 delims=:" %%# in (' type tmpCurl.json^|find /i "upload_url"') do echo %%#
but it give this much output:
"https