Solved to read a first word of First line from abc.text into a var

January 14, 2015 at 02:41:53
Specs: Windows 7
Hello,
Can anyone help me to read a first word of First line from abc.text into a variable in Batch Scripting ?
Example :
For /f "line=1 word=1" %a in (abc.txt) do Echo %a

See More: to read a first word of First line from abc.text into a var

Report •


#1
January 14, 2015 at 08:19:05
✔ Best Answer
set /P var=< abc.txt
for /F "tokens=1" %%a in ("%var%") do echo.%%a

Report •

#2
January 14, 2015 at 08:39:10
THanks a lot. Its working fine.

Report •

Related Solutions


Ask Question