How to move all subtitle files to there movie folder

Bulk Rename Utility How-To's

How to move all subtitle files to there movie folder

Postby ggyy020406 » Thu Dec 01, 2022 2:26 am

e.g.

My Video ? movie name folder ? Subs folder ?eng.srt, jp.srt, chi.srt, kr.srt

I have over 1000 movie folder

how to move all .srt files to there movie folder?
ggyy020406
 
Posts: 2
Joined: Thu Dec 01, 2022 2:12 am

Re: How to move all subtitle files to there movie folder

Postby ggyy020406 » Thu Dec 01, 2022 2:53 am

don't know why all comes "?"
go again...

e.g.

My Video -> movie name folder -> Subs folder -> eng.srt, jp.srt, chi.srt, kr.srt

I have over 1000 movie folder

how to move all .srt files to there movie folder?
ggyy020406
 
Posts: 2
Joined: Thu Dec 01, 2022 2:12 am

Re: How to move all subtitle files to there movie folder

Postby Ronstang » Fri Jan 06, 2023 9:41 pm

I am not sure this excellent utility can move files....but I think I may be able to help you here.

Go to http://www.voidtools.com and get the "Everything" utility. It will allow you to search for all of a certain type of file, folder etc. based on name or type. You can just use it to search for "video" and then just like like File Explorer you can select all your movies at once or a few at a time and move them all into one folder. Then you can move all your subtitle files into the same folder. Then you can create a batch file with the following contents:

@echo off
setlocal

set "basename=."
for /F "tokens=1* delims=." %%a in ('dir /B /A-D ^| sort /R') do (
set "filename=%%a"
setlocal EnableDelayedExpansion
for /F "delims=" %%c in ("!basename!") do if "!filename:%%c=!" equ "!filename!" (
set "basename=!filename!"
if NOT "aa" equ "!filename!" md "!basename!"
)
if NOT "aa" equ "!filename!" move "!filename!.%%b" "!basename!"
for /F "delims=" %%c in ("!basename!") do (
endlocal
set "basename=%%c
)
)

Then just save as "name.bat" and put the batch file into the same folder as all your movies and subtitles. Now, all the subtitle files and movie files need to named the same for each individual movie, but if they aren't already they won't play automatically anyway so if they are not you have to manually edit the names to the same. Then execute the batch file which will move all the movies and subtitles into their own folder based on name. The biggest hiccup I have found with this batch file is that if the name of the file has a period in the name like "Mr." then it truncates the folder name before the period so you have to quickly fix that afterwards of remove the periods beforehand and add them back if needed....now doing that I bet someone can help you with HERE!

The result will be a folder full of folders that contain individual movied with their respective subtitle files.....then you can sort and move them where you want them. You may have to do some cleanup as the batch file is not always perfect and sometimes puts similar named movies all in the same folder but that is easily corrected.

This is how I get all my movies and subs into the same folder after I encoded them from TS files.
Ronstang
 
Posts: 45
Joined: Tue Feb 09, 2021 2:14 am

Re: How to move all subtitle files to there movie folder

Postby Ronstang » Fri Jan 06, 2023 10:05 pm

I don't know how to edit posts here but the formatting on the batch file is incorrect when it saved, the following lines should all be indented:

The following lines need to be indented 3 lines:

set "filename=%%a"
setlocal EnableDelayedExpansion
for /F "delims=" %%c in ("!basename!") do if "!filename:%%c=!" equ "!filename!" (

Then the following need to be indented 6 lines:

set "basename=!filename!"
if NOT "aa" equ "!filename!" md "!basename!"

Then the following lines need to be indented only 3 lines:

)
if NOT "aa" equ "!filename!" move "!filename!.%%b" "!basename!"
for /F "delims=" %%c in ("!basename!") do (

Then the following lines need to be indented 6 lines:

endlocal
set "basename=%%c

Then indent the following 3 spaces:

)

The rest of the lines are left hand justified. I'm sorry this is such a mess but I don't know how to post this with the proper formatting retained.....If someone does maybe they can correct it for both of us...LOL.
Ronstang
 
Posts: 45
Joined: Tue Feb 09, 2021 2:14 am

Re: How to move all subtitle files to there movie folder

Postby therube » Mon Jan 09, 2023 6:19 pm

I am not sure this excellent utility can move files

At least in the 1.5 Alpha version, it can.


(It can probably do what the OP requested too, directly, I'd think, but the "how" is beyond me, but worth perusing their forums.)
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm

Re: How to move all subtitle files to there movie folder

Postby Ronstang » Wed Jan 11, 2023 5:14 am

therube wrote:
I am not sure this excellent utility can move files

At least in the 1.5 Alpha version, it can.


(It can probably do what the OP requested too, directly, I'd think, but the "how" is beyond me, but worth perusing their forums.)


Well, if that is true that is awesome and I would like to know how to do it too now!
Ronstang
 
Posts: 45
Joined: Tue Feb 09, 2021 2:14 am


Return to How-To