batch file to strip numbers from filename and pad to two digits
- by ss2k
I have a text file with a list of server names (servers.txt) that looks something like this:
server1
server2
server3
I have a feeling this can be done with the FOR command as I use that to perform an action on each name in the file, but I'm not quite sure how to use the delimiters to accomplish this.
for /F "tokens=*" %%G in (servers.txt) do (
SET machinenum = <magic here>
ECHO %machinenum%
)
expected output
01
02
03