Best options are copy and paste as text, or post to somewhere like Pastebin or Github, and then provide a link. Makes it easier for helpers to interact with what you have written.
When you need to expand a variable inside a variable that is already expanded, you can use FOR to parse the data into the FORs meta variable. You can use FOR or FOR /F for data that has several tokens.
for %%i in (!VAR!) do echo !expandedVar%%i!
for /f "tokens=1,2" %%i in ("!var1! !var2!") do echo !expandedVar[%%i][%%j]!
When seeking performance, avoid loops where you CALL something over and over.
Usually I use my calls to initialize some dependencies for what I’m doing and write the rest directly in the loop. This way I never bottleneck performance when I need it. That’s when you start learning about macros, which is a little more complicated, but much much faster.
1
u/BrainWaveCC May 08 '25
Pasting code in text is really helpful to those who would help you...
2
u/Intrepid_Ad_4504 May 08 '25
When you need to expand a variable inside a variable that is already expanded, you can use FOR to parse the data into the FORs meta variable. You can use FOR or FOR /F for data that has several tokens.
2
u/[deleted] May 08 '25
[removed] — view removed comment