Maybe you can help me guys, here's what I'm trying to do.
I have a text file which looks more or less like this:
something else
blah blah blah
Name: "value"; Param2: "value"; Param3: "value";
...
Name: "value"; Param3: "value"; Param4: "value"; Param5: "value";
more of something else
I'm looking for lines that start with "Name:" string and within that line I'll be interested in the value of one of those 'parameters' (every time I run it might be a different one). Every line might have a different amount of those parameters and might not contain the one I'm searching for.
So for example the parameter I'm looking for is 'Width:' and I need values from all lines that have that name. An example line I'm searching for could look like this
Name: "Test"; Range: "32"; Color: "#FFFFFF"; Width: "11"; Opacity: "0.1";
I need to get that Width value, which is 11.
So far I've managed to come up with this:
for /f "delims=" %%a in ('FIND "Name: " %1') do (
echo %%a
)
This finds every line with names and values withing the file (as mentioned before this file also contains some other stuff I don't need) and obviously outputs it. Now I have no idea how to find if there is a desired parameter and how to get it's value. I was thinking about searching for the param withing the line (from the example it would be Width: ", the cutting it out along with everything before it, then search for dual quotes and cutting them along with everything afterwords. This should leave just the desired value. I wasn't able to do it tho, hence I'm here asking for help.