I have a text file which is made up of a new value on each line. The amount of lines will vary (expand over time).
I would like to set a variable in a batch file for each of those values. Does anybody know how to do that?
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.
If you just want to read from each line of the file into separate variable then use this. It can also be configured into a loop if you want it to get all the lines instead of just specific lines that way you wouldn’t have to put 100 commands for 100 lines.
Make sure the
endlocalis after the use of the variables.If you want to write to specific lines in the text file, here is a post for that.
Write batch variable into specific line in a text file