On Fri, 22 Jan 2016 12:21:46 +1100, foxidrive says...
Post by foxidriveset "pattern=(.*\\.*)(S[0-9][0-9]E[0-9][0-9])(.*)"
call :routine format-S01E03
set "pattern=(.*\\.*)([0-9][0-9]x[0-9][0-9])(.*)"
call :routine format-01X03
set "pattern=(.*\\.*)([0-9][0-9][0-9])(.*)"
call :routine format-103
[shrugging shoulders]
Keep in mind, my newsreader is not concatenating outside of 75±
characters. I hope I used that word right. ;-)
I'm not getting the part in the script, where it's all "103". Help?
Directory contents:
Burn Notice.207.srt
Burn Notice.208.srt
Burn Notice.S02E07.Rough Seas.avi
Burn Notice.S02E08.Double Booked.avi
Here's a twist... I DID have files where the srt file had the episode name
in it, but not the video file. What a super batch that would be, if it
could look for SxxExx in EITHER file, match that up with the various
formats; 207, 02x07 and S02E07 in either file and mirror them.
I'd buy THAT for a dollar.
What batch did:
N:\DVD's\Watched\Burn Notice\Season 2\Test>set "file=H:\Temp\sarfile-
16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>if exist "H:\Temp\sarfile-
16013.vbs" goto :loop
N:\DVD's\Watched\Burn Notice\Season 2\Test>set "pattern=(.*\\.*)(S[0-9][0-
9]E[0-9][0-9])(.*)"
N:\DVD's\Watched\Burn Notice\Season 2\Test>call :routine format-S01E03
N:\DVD's\Watched\Burn Notice\Season 2\Test>set out=regex.replace
(wscript.stdin.readall,"$2|$1$2$3")
N:\DVD's\Watched\Burn Notice\Season 2\Test>set "global=true"
N:\DVD's\Watched\Burn Notice\Season 2\Test>set "case=false"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(set regex=new regexp 1>"H:
\Temp\sarfile-16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(regex.global=true 1>>"H:
\Temp\sarfile-16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(regEx.IgnoreCase=false
1>>"H:\Temp\sarfile-16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(regex.pattern="(.*\\.*)(S
[0-9][0-9]E[0-9][0-9])(.*)" 1>>"H:\Temp\sarfile-16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(wscript.stdOut.write
regex.replace(wscript.stdin.readall,"$2|$1$2$3") 1>>"H:\Temp\sarfile-
16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(Getting the list of video
files for format-S01E03
Getting the list of video files for format-S01E03
N:\DVD's\Watched\Burn Notice\Season 2\Test>(for /F "delims=" %a in (' dir
*.mkv *.avi *.mov *.mp4 *.mpg /b /a-d /s ') do echo %a ) 1>"H:\Temp
\sarfile-16013.vbs.2"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(Processing the format-
S01E03 list...
Processing the format-S01E03 list...
N:\DVD's\Watched\Burn Notice\Season 2\Test>(for /F "tokens=1,* delims=|" %
a in (' cscript /nologo "H:\Temp\sarfile-16013.vbs" < "H:\Temp\sarfile-
16013.vbs.2" ') do if exist "%~dpb*%a*.srt" (echo(@ren "%~dpb*%a*.srt" "%
~nb.srt" ) ) 1>"+format-S01E03.bat.txt"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(@echo "format-S01E03"
renaming done 1>>"+format-S01E03.bat.txt"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(
N:\DVD's\Watched\Burn Notice\Season 2\Test>set "pattern=(.*\\.*)([0-9][0-
9]x[0-9][0-9])(.*)"
N:\DVD's\Watched\Burn Notice\Season 2\Test>call :routine format-01X03
N:\DVD's\Watched\Burn Notice\Season 2\Test>set out=regex.replace
(wscript.stdin.readall,"$2|$1$2$3")
N:\DVD's\Watched\Burn Notice\Season 2\Test>set "global=true"
N:\DVD's\Watched\Burn Notice\Season 2\Test>set "case=false"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(set regex=new regexp 1>"H:
\Temp\sarfile-16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(regex.global=true 1>>"H:
\Temp\sarfile-16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(regEx.IgnoreCase=false
1>>"H:\Temp\sarfile-16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(regex.pattern="(.*\\.*)
([0-9][0-9]x[0-9][0-9])(.*)" 1>>"H:\Temp\sarfile-16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(wscript.stdOut.write
regex.replace(wscript.stdin.readall,"$2|$1$2$3") 1>>"H:\Temp\sarfile-
16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(Getting the list of video
files for format-01X03
Getting the list of video files for format-01X03
N:\DVD's\Watched\Burn Notice\Season 2\Test>(for /F "delims=" %a in (' dir
*.mkv *.avi *.mov *.mp4 *.mpg /b /a-d /s ') do echo %a ) 1>"H:\Temp
\sarfile-16013.vbs.2"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(Processing the format-
01X03 list...
Processing the format-01X03 list...
N:\DVD's\Watched\Burn Notice\Season 2\Test>(for /F "tokens=1,* delims=|" %
a in (' cscript /nologo "H:\Temp\sarfile-16013.vbs" < "H:\Temp\sarfile-
16013.vbs.2" ') do if exist "%~dpb*%a*.srt" (echo(@ren "%~dpb*%a*.srt" "%
~nb.srt" ) ) 1>"+format-01X03.bat.txt"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(@echo "format-01X03"
renaming done 1>>"+format-01X03.bat.txt"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(
N:\DVD's\Watched\Burn Notice\Season 2\Test>set "pattern=(.*\\.*)([0-9][0-
9][0-9])(.*)"
N:\DVD's\Watched\Burn Notice\Season 2\Test>call :routine format-103
N:\DVD's\Watched\Burn Notice\Season 2\Test>set out=regex.replace
(wscript.stdin.readall,"$2|$1$2$3")
N:\DVD's\Watched\Burn Notice\Season 2\Test>set "global=true"
N:\DVD's\Watched\Burn Notice\Season 2\Test>set "case=false"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(set regex=new regexp 1>"H:
\Temp\sarfile-16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(regex.global=true 1>>"H:
\Temp\sarfile-16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(regEx.IgnoreCase=false
1>>"H:\Temp\sarfile-16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(regex.pattern="(.*\\.*)
([0-9][0-9][0-9])(.*)" 1>>"H:\Temp\sarfile-16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(wscript.stdOut.write
regex.replace(wscript.stdin.readall,"$2|$1$2$3") 1>>"H:\Temp\sarfile-
16013.vbs"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(Getting the list of video
files for format-103
Getting the list of video files for format-103
N:\DVD's\Watched\Burn Notice\Season 2\Test>(for /F "delims=" %a in (' dir
*.mkv *.avi *.mov *.mp4 *.mpg /b /a-d /s ') do echo %a ) 1>"H:\Temp
\sarfile-16013.vbs.2"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(Processing the format-103
list...
Processing the format-103 list...
N:\DVD's\Watched\Burn Notice\Season 2\Test>(for /F "tokens=1,* delims=|" %
a in (' cscript /nologo "H:\Temp\sarfile-16013.vbs" < "H:\Temp\sarfile-
16013.vbs.2" ') do if exist "%~dpb*%a*.srt" (echo(@ren "%~dpb*%a*.srt" "%
~nb.srt" ) ) 1>"+format-103.bat.txt"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(@echo "format-103"
renaming done 1>>"+format-103.bat.txt"
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(
N:\DVD's\Watched\Burn Notice\Season 2\Test>echo(done! - check the
"+*.bat.txt" files in "N:\DVD's\Watched\Burn Notice\Season 2\Test" folder
done! - check the "+*.bat.txt" files in "N:\DVD's\Watched\Burn Notice
\Season 2\Test" folder
N:\DVD's\Watched\Burn Notice\Season 2\Test>del "H:\Temp\sarfile-
16013.vbs*"
N:\DVD's\Watched\Burn Notice\Season 2\Test>goto :EOF