I got this simple code which read an array in json and place values in independent variables %1%, %2%, %3% and %4% instead of that I would like to place these values inside an array myarray[1], myarray[2], myarray[3] and myarray[4], how could I modifiy the code to achieve this goal?
rem Load stats for exemple do set stats={ 1: "10%", 2: "20%", 3: "30%", 4: "40%" }
for /f "delims=" %%x in (stats.json) do set stats=%%x
rem Remove quotes
set stats=%stats:"=%
rem Remove braces
set "stats=%stats:~2,-2%"
rem Change colon+space by equal-sign
set "stats=%stats:: ==%"
echo %stats%
rem Separate parts at comma into individual assignments
set "%stats:, =" & set "%"
from this stackoverflow answer : https://stackoverflow.com/a/36375415/876637