Hello,
Having some problem trying to get this script working....wondering if I may have some help.
I am trying to create folders based on a given search result.
Example:
Jazz.Dance.Clips.E01.Danielle.Multi-Clips/clip1.avi , clip2.avi , etc. (this is a folder with mulitple files in it)
Tap.Dance.Clips.E05.Britney.Multi-Clips/clip1.avi , clip2.avi , etc. (this is a folder with multiple files in it)
I would like the script to match the text before the .E01 and or .E*** , "all my files are labelled like this".
I need the script to create a folder based on this search and then move the folder from example into the create folder
Results:
Jazz.Dance.Clips/Jazz.Dance.Clips.E01.Danielle.Multi-Clips/clip1.avi , clip2.avi , etc.
Tap.Dance.Clips/Tap.Dance.Clips.E05.Britney.Multi-Clips/clip1.avi , clip2.avi , etc.
I have many, many more Titles I guess you could say, but the .E01 or .E02 will always be right after the title I want to make the folder.
I looked around for sometime to find a similar code from the findstr command, but can't seem to find what I need.
Thanks for the help!
Batch File Help
Moderator: DosItHelp
Re: Batch File Help
Are all the folders you want moved, under one folder, or do they descend into Subdirectories?
Re: Batch File Help
sorry, more info...
The folders to search are all in one folder.
Working/Jazz.Dance.Clips.E01.Danielle.Multi-Clips
Working/Tap.Dance.Clips.E05.Britney.Multi-Clips
etc
etc
I would like to move them to another folder on my shared network
//Kristy/Complete/
The folders to search are all in one folder.
Working/Jazz.Dance.Clips.E01.Danielle.Multi-Clips
Working/Tap.Dance.Clips.E05.Britney.Multi-Clips
etc
etc
I would like to move them to another folder on my shared network
//Kristy/Complete/
Re: Batch File Help
This uses a free program called GnuSed to create a temporary batch file which should work.
It is designed to processes the current folder only.
Download GnuSed and see if the path is correct to sed in the batch file below.
When you run the batch file it should create a temp.bat.txt file which you can examine in notepad to see if the commands are right.
It is designed to processes the current folder only.
Download GnuSed and see if the path is correct to sed in the batch file below.
When you run the batch file it should create a temp.bat.txt file which you can examine in notepad to see if the commands are right.
Code: Select all
@echo off
dir /b /ad |"C:\Program Files\GnuWin32\bin\sed" "s/\(.*\)\.E[0-9][0-9].*/md \x22\1\x22 \& move \x22&\\*.*\x22 \x22\1\x22/" >temp.bat.txt
Re: Batch File Help
the output looks right..this is what i got from the temp.bat.txt that was created
md "Jazz.Dance.Clips" & move "Jazz.Dance.Clips.E01.Danielle.Multi-Clips\*.*" "Jazz.Dance.Clips"
i think i can proceed with actually doing it.... not sure what to change in the code to make it actually move the folders and not just make a txt file.
can we add a command after this
-move all folders in the Working/ to a network share //KRISTY/Complete.Videos/
-if in //KRISTY/Complete.Videos/ a folder already exists, "Jazz.Dance.Clips" to still move all files from Working/ overwriting if necessary.
Thanks again for the help.
md "Jazz.Dance.Clips" & move "Jazz.Dance.Clips.E01.Danielle.Multi-Clips\*.*" "Jazz.Dance.Clips"
i think i can proceed with actually doing it.... not sure what to change in the code to make it actually move the folders and not just make a txt file.
can we add a command after this
-move all folders in the Working/ to a network share //KRISTY/Complete.Videos/
-if in //KRISTY/Complete.Videos/ a folder already exists, "Jazz.Dance.Clips" to still move all files from Working/ overwriting if necessary.
Thanks again for the help.
Re: Batch File Help
Silent44 wrote:the output looks right..this is what i got from the temp.bat.txt that was created
md "Jazz.Dance.Clips" & move "Jazz.Dance.Clips.E01.Danielle.Multi-Clips\*.*" "Jazz.Dance.Clips"
i think i can proceed with actually doing it.... not sure what to change in the code to make it actually move the folders and not just make a txt file.
You have to create a copy of the data in another folder and test the batch file there.
If it works for you then you can automate it as below.
Code: Select all
@echo off
dir *.E* /b /ad |"C:\Program Files\GnuWin32\bin\sed" "s/\(.*\)\.E[0-9][0-9].*/md \x22\1\x22 \& move \x22&\\*.*\x22 \x22\1\x22/" >temp.bat
call temp.bat
del temp.bat
can we add a command after this
-move all folders in the Working/ to a network share //KRISTY/Complete.Videos/
-if in //KRISTY/Complete.Videos/ a folder already exists, "Jazz.Dance.Clips" to still move all files from Working/ overwriting if necessary.
Once the folders are modified it only takes a drag and drop to copy them across the network. The hard work is done.
You can try this command though.
dir *.E* /b /ad |"C:\Program Files\GnuWin32\bin\sed" "s/\(.*\)\.E[0-9][0-9].*/md \x22\\\\KRISTY\\Complete.Videos\\\1\x22 2>nul \& move \/y \x22&\\*.*\x22 \x22\\\\KRISTY\\Complete.Videos\\\1\x22/" >temp.bat.txt
Re: Batch File Help
Works great! and you are right it is simple enough to move them all to a network share after.
I will have a look at that code you pasted though.
Thanks again so much, saved me a lot of time here!!
Regards,
Ryan
I will have a look at that code you pasted though.
Thanks again so much, saved me a lot of time here!!
Regards,
Ryan