What I want to do is, I have a text file (List.txt) and through batch script I want to read (line by line) the text file and save the line in some variable for later use. Following the the batch script that I am trying, but don't know the reason why isn't it working?
@echo off
set _filePath= List.txt
@echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%a in (%_filePath%) do (
set _var = %%a
echo !_var!
)
List.txt file has:
abc|def
1234|defg
abcde|98745
and the output is:-
ECHO is off
ECHO is off
ECHO is off
what I want is:
abc|def
1234|defg
abcde|98745
Can someone help me out with it?