Batch program to move files to separate folders

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
david81 Offline
Senior Member
Posts: 156
Joined: Dec 2008
Reputation: 0
Post: #21
Hitcher Wrote:Blimey, how'd you manage to find that?

I've been blessed with a memory that holds on to the useless little stuff but seems to let go of the important things.

I just remembered the thread where I got it and who posted it. Was pretty easy to find after that. Smile
find quote
Montellese Online
Team-XBMC Developer
Posts: 2,790
Joined: Jan 2009
Reputation: 20
Location: Switzerland
Post: #22
Nmarconi Wrote:Below is the link to the .net program I threw together that will convert a folder full of flat movies like this:

All Movies\Movie Title.mkv (or avi, mp4, m4v, iso, mov, img)
All Movies\Movie Title.tbn
All Movies\Movie Title.nfo
All Movies\Movie Title-fanart.jpg

And converts to either of these options:

1)
All Movies\Movie Title\Movie Title.mkv (or whatever the original ext was)
All Movies\Movie Title\Movie Title.tbn
All Movies\Movie Title\Movie Title.nfo
All Movies\Movie Title\Movie Title-fanart.jpg

2)
All Movies\Movie Title\Movie Title.mkv
All Movies\Movie Title\movie.tbn
All Movies\Movie Title\movie.nfo
All Movies\Movie Title\fanart.jpg

THE PROGRAM WILL NOT WORK IF YOU HAVE YOUR MOVIES IN VOB FOLDERS!
THE PROGRAM WILL NOT MOVE TRAILERS!
THE PROGRAM WILL NOT WORK WITH MULTIPLE PART MOVIES!


I HIGHLY RECOMMEND YOU SETUP A TEST FOLDER TO TRY OUT YOUR SPECIFIC SETUP.

http://www.mediafire.com/?indtoihihhy

Hope this helps! Also, seriously - please test it on a small folder to see if your specific setup presents any challenges i did not address. This is intended to be used in very strait forward simple setups.

Nice job, just tested it on a test folder and it worked perfectly. Gonna let it go berserk on all my movies tomorrow.

Could you extend your program to have it move trailers as well?

BUT I got to report a "bug" ;-) I get an uncaught Exception when clicking "OK" without having selected a folder before.
find quote
Nmarconi Offline
Aeon Group
Posts: 77
Joined: Oct 2008
Location: Boston
Post: #23
Montellese Wrote:Nice job, just tested it on a test folder and it worked perfectly. Gonna let it go berserk on all my movies tomorrow.

Could you extend your program to have it move trailers as well?

BUT I got to report a "bug" ;-) I get an uncaught Exception when clicking "OK" without having selected a folder before.

Ah, yeah, like i said, i threw this thing together. I could add trailers. Let me look to see how difficult it would be.
find quote
Montellese Online
Team-XBMC Developer
Posts: 2,790
Joined: Jan 2009
Reputation: 20
Location: Switzerland
Post: #24
Nmarconi Wrote:Ah, yeah, like i said, i threw this thing together. I could add trailers. Let me look to see how difficult it would be.

Thanks for your effort.

Trailers could be detected with something like <moviename>-trailer.<ext> where the extension could be anything like mov, avi etc so I wouldn't really care about it.
find quote
LaTropa64 Offline
Fan
Posts: 649
Joined: Nov 2005
Reputation: 0
Post: #25
My solutions was pretty low tech. I'm no programmer. All my movies have an nfo associated with them that were named exactly the same as the movie so this is what I did:

At a dos prompt in my movie directory: dir /b *.nfo > movie.bat

Then I edited movie.bat and did a find and replace .nfo with nothing
replaced regular expression ^ (beginning of line) with mkdir "
replaced regular expression $ (end of line with) "

Everything in movie.bat ended up looking like this

[INDENT]mkdir "300 (2006)"
mkdir "Batman The Dark Knight (2008)"
mkdir "Corpse Bride (2005)"
etc...[/INDENT]

Then I ran the batch file and it created all the directories.

To move them, I went back to the batch file and turned it into a giant list that looked like this with more find and replace:

[INDENT]"300 (2006)"
"Batman The Dark Knight (2008)"
"Corpse Bride (2005)"
[/INDENT]

Imported it into excel in two different columns and turned it into a new text file (again, called movie.bat) that looked like this

[INDENT]"300 (2006)" "300 (2006)"
"Batman The Dark Knight (2008)" "Batman The Dark Knight (2008)"
"Corpse Bride (2005)" "Corpse Bride (2005)"[/INDENT]

I edited that list to replace regular expression ^ with move
replaced " " with *" "

So now it looked like this

[INDENT]move "300 (2006)*" "300 (2006)"[/INDENT]

And then ran the new movie.bat. All done.
find quote
Nmarconi Offline
Aeon Group
Posts: 77
Joined: Oct 2008
Location: Boston
Post: #26
Montellese Wrote:Thanks for your effort.

Trailers could be detected with something like <moviename>-trailer.<ext> where the extension could be anything like mov, avi etc so I wouldn't really care about it.

All set - added trailers and fixed little bug.

Download here:

http://www.mediafire.com/download.php?3mwd2awiynw
find quote
jtap06 Offline
Senior Member
Posts: 233
Joined: Jan 2009
Reputation: 0
Location: Chicago, IL
Post: #27
Great! Just what I was holding out for. Thanks a lot for your help Nmarconi and others!
find quote
Montellese Online
Team-XBMC Developer
Posts: 2,790
Joined: Jan 2009
Reputation: 20
Location: Switzerland
Post: #28
Nmarconi Wrote:All set - added trailers and fixed little bug.

Download here:

http://www.mediafire.com/download.php?3mwd2awiynw

Man this tool works like a charm, very well done.
Somehow it didn't take my trailers with <moviename>-trailer.mov (e.g. "300-trailer.mov" or "Bee Movie-trailer.mov") but as I only just started getting trailers I only had to move around 30 trailers.

Thanks again for your work.

EDIT: Just noticed that your tool missed my .ts files but as there were only two I don't mind that either :-)
(This post was last modified: 2009-05-03 15:54 by Montellese.)
find quote
Nmarconi Offline
Aeon Group
Posts: 77
Joined: Oct 2008
Location: Boston
Post: #29
Montellese Wrote:Man this tool works like a charm, very well done.
Somehow it didn't take my trailers with <moviename>-trailer.mov (e.g. "300-trailer.mov" or "Bee Movie-trailer.mov") but as I only just started getting trailers I only had to move around 30 trailers.

Thanks again for your work.

EDIT: Just noticed that your tool missed my .ts files but as there were only two I don't mind that either :-)

Ahh yeah - must have been a typo that caused mov trailers to be missed and i wasn't thinking about ts files - ill fix the mov trailers and add ts files and upload version 3 when i get home tomorrow night.
find quote
marklight Offline
Junior Member
Posts: 22
Joined: Feb 2009
Reputation: 0
Post: #30
anyone know of a mac program that will do this? I have all my movies and poster files and nfo's in one folder, and would like to store them in separate folders as well.
find quote