Read a txt line by line in a batch file
batch-file, for-loop
Solution
The command is FOR with /F parameter like this
FOR /F %i in (yourFile.txt) DO yourcommand %i
this reads a line at a time from the text file and insert the value into the %i argument Then call the command specified after the DO keyword (the command could be another batch with the copy or move operations required)
Problem
Here is my problem. I have a txt file with 100 different video names (examples): ``` abc.mpg def.mpg ghi.mpg xyz.mpg ``` I want to process those videos one by one using some commands and put the results into a folder with the same name (without the extension): ``` command1 abc.mpg command2 abc.mpg move results .\abc ``` My question is how can I perform the above iteration with a for loop within a batch file.