In a program am getting one input say name….
From a file i read value line by line:
say file contains…
hello
hai
If i want to print like
hello name in batch file
hai name in batch file
How to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The following (pure
cmd) script will do it:For the input file (
infile.txt):hello haiit produces:
I gather you’d need to adjust the “name in batch file” bit of the script to be something more suitable (like
"Bob"for example).Update:
Provided you have correctly created the
namevariable before entering theforloop, you can also use variables for the name. For example, the following script:allows:
c:\pax> _