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]!
More Related Contents:
- Why is no string output with ‘echo %var%’ after using ‘set var = text’ command in cmd? [duplicate]
- What are the ERRORLEVEL values set by internal cmd.exe commands?
- How to run multiple .BAT files within a .BAT file
- Assign output of a program to a variable using a MS batch file
- Displaying Windows command prompt output and redirecting it to a file
- Assign command output to variable in batch file
- Can I mask an input text in a bat file?
- Why doesn’t this FINDSTR example with multiple literal search strings find a match?
- What is the difference between % and %% in a cmd file?
- How to read and print contents of text file line by line?
- Logical operators (“and”, “or”) in DOS batch
- Windows batch command(s) to read first line from text file
- What does single-quoting do in Windows batch files?
- How to create empty text file from a batch file?
- What does “&&” do in this batch file?
- Arithmetic operations with HH:MM:SS times in batch file
- How do I compare timestamps of files in a batch script?
- Open a URL without using a browser from a batch file
- How to run multiple DOS commands in parallel?
- Why are Danish characters not displayed as in text editor on executing batch file?
- CMD.EXE batch script to display last 10 lines from a txt file
- How can I escape an exclamation mark ! in cmd scripts?
- Does Windows batch support exception handling?
- Batch – Converting variable to uppercase
- Get java version from batch file
- Set a path variable with spaces in the path in a Windows .cmd file or batch file
- Batch file for PuTTY/PSFTP file transfer automation
- Batch file and DEL errorlevel 0 issue
- How do I create a batch file timer to execute / call another batch throughout the day
- To “Call” or “Not to Call” a batch file?