|
Answer» Hi I have created a batch file. And using some parameters in batch file I am Reading parameter value from my notepad file. Other-way around I have create a notepad file with name test.txt which include Monday, April, 01 Tuesday, Nov, 08 Friday, Jan, 31 I have created a batch file which in which I will USE this values as argument. My Batch file is something like: @ECHO off set Day = FOR /F "tokens=1 delims=," %G IN (D:\Framewok\test.txt) DO @echo %G set Month = %FOR /F "tokens=2," %G IN (D:\Framewok\test.txt) DO @echo %G set Date = %FOR /F "tokens=3," %G IN (D:\Framewok\test.txt) DO @echo %G echo echo Day is %Day% echo Month is %Month% echo date equals %Date% pause
Here I am not able to pull any value from text file. Also do let me know if I want only some value in next row i.e. Tuesday Or Jan Or 01 only from notepad how to do this. Can anyone let me know.
Thank you in Advance, You MUST come from the BASH scripting world. Code: [SELECT]@echo off FOR /F "tokens=1-3 delims=," %%G IN (D:\Framewok\test.txt) DO ( set Day=%%G set Month=%%H set Date=%%I setlocal enabledelayedexpansion echo. echo Day is !Day! echo Month is !Month! echo date equals !Date! endlocal )
pause
|