1

I have a file named "test PID 1100 DELAY 322ms.aac" which i am getting using the following code :-

for %%i in (test*.aac) do SET "AACFILE=%%~ni"
D:\Converter\bin\faad.exe -o C:\fb\%1.wav "C:\fb\%AACFILE%.aac"

After this i need to read the numeric value between DELAY and .aac from the file and echo it in the following line at the end.

D:\Converter\bin\EAC3to.exe C:\fb\%1.wav C:\fb\%1-Synced.wav +322ms

Also i need to add 100 to the echoed value, For example if the value in file is 322ms then i want to output 422ms.

1 Answer 1

1

Try this:

@echo off
setlocal enabledelayedexpansion

for /f "tokens=5 delims=. " %%a in (%AACFILE%) do (
  set num=%%a & set num=!num:ms=! & set /a num=!num!+100
  D:\Converter\bin\EAC3to.exe C:\fb\%1.wav C:\fb\%1-Synced.wav +!num!ms
)
Sign up to request clarification or add additional context in comments.

2 Comments

That works, now how do i add these lines at the end of existing line to replace the +322ms ? D:\Converter\bin\EAC3to.exe C:\fb\%1.wav C:\fb\%1-Synced.wav +322ms

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.