This might look as a usual question here in stackflow but it's a bit different on how it operates. I got over a half-a-million+ and counting wav files which I need to sort. All files are stored in a single directory and files are named like:
OUT60105-20151109-161938-144XXXXXXX.70572.WAV
This file was generated from a call on team member's Extension 60105 (OUT60125) on 20151109 (date-of-recording) and the callers Team leader name is Boyly.
OUT60168-20151110-161850-144XXXXXXX.70570.WAV
This file was generated from a call on team member's Extension 60168 (OUT60168) on 20151110 (date-of-recording) and the callers Team leader is Girly.
and so forth...
So with the information above, I'd like to sort all those files to a directory structure below:
F:\Recordings\Team Leader's name\Team member's Extension\date-of-recording
This is what I have so far and honestly, I don't know what's next to perform:
@echo off
setlocal enabledelayedexpansion
set FolderIncoming=F:\Incoming_Rec
set FileMask=OUT*.WAV
set FolderSorted=F:\Recordings\TeamLeader
for %%a in ("%FolderIncoming%\%FileMask%") do (
Set FileName=%%~a
for /f "tokens=1-2 delims=-" %%b in ("%%~nxa") do (
if not exist "%FolderSorted%\%%e\%%b\%%~na.WAV" (
if not exist "%FolderSorted%\%%e\%%b" md "%FolderSorted%\%%e\%%b"
copy "%%a" "%FolderSorted%\%%e\%%b"
)
)
)
How can I go with this? Please note that I have several team leaders and on their team are several members (extensions) as well.