I would like to know how to loop through each line in a text file using a Windows batch file and process each line of text in succession.
Windows – How to loop through each line in a text file using a windows batch file
batch-filewindows
Related Topic
- Windows – How to you find and replace text in a file using the Windows command-line environment
- Split long commands in multiple lines through Windows batch file
- Windows – How to echo a newline in a batch file
- Windows – n equivalent of ‘which’ on the Windows command line?
- What does %~dp0 mean, and how does it work
- Windows – How to run two commands in one line in Windows CMD
Best Answer
I needed to process the entire line as a whole. Here is what I found to work.
The tokens keyword with an asterisk (*) will pull all text for the entire line. If you don't put in the asterisk it will only pull the first word on the line. I assume it has to do with spaces.
For Command on TechNet
If there are spaces in your file path, you need to use
usebackq
. For example.