How to create batch file to take user input and create a text file? -
i have text file test.txt
the contents of test.txt
are:
xxx yyy zzz
i want create batch file "process.bat"
takes 3 inputs
user:
input 1 input 2 input 3
and create text file "output.txt"
below output:
input 1 input 2 "input 3" xxx hello input 1 input 2 "input 3" yyy hello input 1 input 2 "input 3" zzz hello
this should looking for:
echo off setlocal enabledelayedexpansion echo path test.txt set /p filepath= cd %filepath% echo input 1 set /p input1= echo input 2 set /p input2= echo input 3 set /p input3= ( /f %%i in (test.txt) ( echo %input1% %input2% "%input3%" %%i hello >> output.txt )) :eof
if wanted hard code file path in be:
set /p filepath=yourfilepathhere cd %filepath%
Comments
Post a Comment