Code: Select all
@echo off
for %%a in ("%FolderIncoming%\%FileMask%") do (
set FileName=%%~na
set TargetYear=!FileName:~0,4!
set TargetFolder=!TargetYear!\!FileName:~0,10!
if not exist "%FolderSorted%\!TargetFolder!\%%~na.mp3" (
echo Processing '!FileName!' ...
if not exist "%FolderSorted%\!TargetFolder!" md "%FolderSorted%\!TargetFolder!"
"%LameLocation%\lame.exe" -V9 --vbr-new -mm -h -q 0 "%%a" "%FolderSorted%\!TargetFolder!\%%~na.mp3"
)
)
It's working perfectly fine but how can I add the feature where it will place each converted wav file to specific folder location based on IP Extensions. Right now, we 7 extensions (1020, 10201, 10202, 10203, 10204, 10205, 10206) and I want it be be saved in folders as:
Date\Extension\Converted_Files_Here
Examples of saved recording name:
a. 2015-04-10-08-52-15_xxxxxxxxxxxx_10201.mp3
b. 2015-04-10-10-03-52_10202_xxxxxxxxxxx.mp3
Filename (a) should be saved in 2015-04-10\10201\2015-04-10-08-52-15_xxxxxxxxxxxx_10201.mp3
and
Filename (b) should be saved in 2015-04-10\10202\2015-04-10-10-03-52_10202_xxxxxxxxxxx.mp3
It's a bit puzzling since extensions begins, in-between, or ended with _ (underscore).
How can I make this into reality?
Thank you.