Batch - Insert texts in between lines of a text file -
i've been skimming thru other threads can't seem find idea on how implement mine via batch script.
i'm figuring out how can add strings "minimum:", "average:" , "maximum:" in between values has own line.
sample input text file:
server1 1ms 90ms 100ms server2 4ms 16ms 20ms server3 8ms 78ms 154ms
sample output file should be:
server1 minimum: 1ms average: 90ms maximum: 100ms server2 minimum: 4ms average: 16ms maximum: 20ms server3 minimum: 8ms average: 78ms maximum: 154ms
please note server names may not sorted in order values, output server. input file in format.
any appreciated. thanks!
you didn't shown effort write own solution, don't request explanation of free code:
@echo off setlocal enabledelayedexpansion set i=27 set s=minimum: average: maximum: ^ (for /f %%a in (input.txt) ( %%i in (!i!) echo !s:~%%i,9!%%a set /a "i=(i+9)%%36" )) > output.txt
Comments
Post a Comment