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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -