Command Prompt Separation of text by Character [closed]

The script was supposed to put each line of test.txt into a separate variable.

@Echo Off
SetLocal EnableDelayedExpansion
Set "i=0"
For /F "UseBackQ Delims=" %%a In ("test.txt") Do (
    Set/A "i+=1"
    Set "line[!i!]=%%a"
)
For /L %%a In (1,1,%i%) Do Echo=!line[%%a]!

Leave a Comment