Question

hello all i have a list of log files & wants to convert it into text files. In my case i'm able to convert single log file (input: Trace0.log output: output0.txt) using java script command...

start java -jar USB_Trace_Decoder.jar -t Trace.tr -l Trace0.log -o outputlog\output0.txt.

I have to perform the above code multiple times with change in input and output filename in each iteration. How can i do the same to get desired result

Was it helpful?

Solution

Try this:

@echo off
setlocal enabledelayedexpansion
set i=0
for /f "Tokens=*" %%a in ('dir /b /on trace*.log') do (
 echo start java -jar USB_Trace_Decoder.jar -t Trace.tr -l %%~nxa -o outputlog\output!i!.txt
 set /a i+=1
 )
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top