Number of tokens limit in a FOR command in a Windows batch script

后端 未结 6 2058
無奈伤痛
無奈伤痛 2020-12-04 00:24

I was trying to process a text file in a Windows batch script and I ran into something that looks like a limitation to 31 tokens in a FOR loop. I isolated the issue in the c

6条回答
  •  情歌与酒
    2020-12-04 01:01

    From for /?:

    %i is explicitly declared in the for statement and the %j and %k are implicitly declared via the tokens= option. You can specify up to 26 tokens via the tokens= line, provided it does not cause an attempt to declare a variable higher than the letter 'z' or 'Z'. Remember, FOR variables are single-letter, case sensitive, global, and you can't have more than 52 total active at any one time.

提交回复
热议问题