Click here for important information about

reading variable value frm 'parameter.txt file into test.bat

March 6, 2013 at 04:38:28
Specs: Windows 7
I am new with the batch script.
I have values in parameter.txt file as below


then in my test.bat file, I need a value of variable "$$CURR_YEAR_MONTH_WID_C1" as 201212
and "$$CURR_YEAR_MONTH_WID_C2 as 201303.

i am not sure what should i put in IF ELSE block, i have written batch script(test.bat) as below

rmdir "D:\Batch_files\Datacollection files rahw"
md "D:\Batch_files\Datacollection files rahw"
set dd=%date%
set yyyy=%dd:~10,4%
set mm=%dd:~4,2%
for /f "delims=" %%x in (D:\param_files\Parameter_File_rahw_org.txt) do (
IF %%x ==CUSTOM_1 (
set yyyymm=%%x
echo %yyyymm%
) ELSE (
echo not matched

See More: reading variable value frm parameter.txt file into test.bat

March 6, 2013 at 10:41:57
@echo off & setlocal enabledelayedexpansion
for /f "tokens=*" %%a in (file.txt) do set %%a 2>nul
set $$
for %%a in (1 2) echo.!$$CURR_YEAR_MONTH_WID_C%%a!

Report •
Related Solutions

Ask Question