Reading a text file line by line and storing it in an array using batch script

后端 未结 4 607
猫巷女王i
猫巷女王i 2021-01-05 14:57

I want to read a text file and store each line in an array. When I used the code below, \"echo %i%\" is printing 0 every time and only array[

4条回答
  •  甜味超标
    2021-01-05 15:44

    Read set /? description about environment run-time linking. When you are using %i% inside for - it is pre-expanded before for execution. You need to use !i! instead.

提交回复
热议问题