Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Separating file types into identical folder structure


  • Please log in to reply
7 replies to this topic

#1 alpinemonkey

alpinemonkey

  • Members
  • 13 posts
  • OFFLINE
  •  
  • Local time:01:50 PM

Posted 23 January 2017 - 04:19 PM

I have a large number of images and videos in an organised folder structure.  What I would like to do is create an identical folder structure but only have the video in the new, duplicate folders.  The result would be two sets of folders, one with all the images in and one with all the video in.

 

Is there a way to achieve this?

 

Thanks in advance.



BC AdBot (Login to Remove)

 


#2 chalup

chalup

  • Members
  • 191 posts
  • OFFLINE
  •  
  • Local time:08:50 AM

Posted 23 January 2017 - 04:24 PM

Couldn't you just sort the folder by file type and then copy/paste/delete excess?



#3 alpinemonkey

alpinemonkey
  • Topic Starter

  • Members
  • 13 posts
  • OFFLINE
  •  
  • Local time:01:50 PM

Posted 23 January 2017 - 04:28 PM

Yes, obviously, but it would take me a very long time and be a laborious job. I'm looking for a more automated way to do it if possible.

#4 britechguy

britechguy

    Been there, done that, got the T-shirt


  • Moderator
  • 7,498 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:Staunton, VA
  • Local time:09:50 AM

Posted 23 January 2017 - 06:08 PM

Use the ROBOCOPY command in Command Prompt.

 

Here's an example to copy all GIF and JPG files from one folder (including subfolders - that's what the /S is about) to another:

 

ROBOCOPY C:\Users\USER1\ImagesVids  C:\IMAGES *.gif *.jpg /S

 

and, to do the same for specific video file types:

 

ROBOCOPY C:\Users\USER1\ImagesVids  C:\VIDS *.mov *.mpg /S

 

When I did my testing I had already created the C:\IMAGES and C:\VIDS folders before executing the ROBOCOPY command.  Of course, one substitutes the correct source directory, which is the first argument to the command, and destination directory, which is the second.  The third through nth will be the *.extension list of all the extensions you wish to snag, and the final argument is the /S that says to include all subfolders as part of this process as well.


Brian AKA Bri the Tech Guy (website in my user profile) - Windows 10 Home, 64-Bit, Version 1803, Build 17134 

 

     In a modern society where everyone thinks their opinion deserves to be heard nothing annoys me more than individuals who mistake their personal preferences for fact.

         ~ Commenter TheCruyffGurn on the The Guardian website, 8/13/2014

 

              

 


#5 britechguy

britechguy

    Been there, done that, got the T-shirt


  • Moderator
  • 7,498 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:Staunton, VA
  • Local time:09:50 AM

Posted 28 January 2017 - 06:53 PM

Just wondering if the Original Poster tried ROBOCOPY and what you thought of the result.  This is one of the best command line tools, and with tons of ways to control exactly what it does, for selectively creating "mirror" folder structures and moving or copying files into same.


Brian AKA Bri the Tech Guy (website in my user profile) - Windows 10 Home, 64-Bit, Version 1803, Build 17134 

 

     In a modern society where everyone thinks their opinion deserves to be heard nothing annoys me more than individuals who mistake their personal preferences for fact.

         ~ Commenter TheCruyffGurn on the The Guardian website, 8/13/2014

 

              

 


#6 alpinemonkey

alpinemonkey
  • Topic Starter

  • Members
  • 13 posts
  • OFFLINE
  •  
  • Local time:01:50 PM

Posted 29 January 2017 - 03:30 AM

Thanks so much for the advice on this. It looks like it's exactly what I need. Sorry for the delay in replying too.

I haven't tried it yet but will give it a go as soon as I can.

Just for clarity, will this command recreate the folder structure at the destination too, or just copy all the selected file types in to one folder?

#7 britechguy

britechguy

    Been there, done that, got the T-shirt


  • Moderator
  • 7,498 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:Staunton, VA
  • Local time:09:50 AM

Posted 29 January 2017 - 11:45 AM

It recreates the entire folder structure under the destination folder specified.   Do a web search on ROBOCOPY and you'll find the manual pages for it, which are much easier to read than the help that you get back in command prompt.  This set of results on ROBOCOPY examples can prove very helpful in getting your head around what some of the more common ways of using it are.

 

What you want to do is simple.  

 

If you know that all you have under the folder structure you want to separate out into one for video files and one for image files you could run the ROBOCOPY command with the move switch rather than the default copy behavior.  The only thing I'll say in warning is that you really need to know the actual file extensions that you're intending to move or copy.  I would probably use the move option, myself and run ROBOCOPY once for the image files and once for the video files.  That way you can double check afterward that there are no remaining files in the original folder structure from which you were relocating the files.  It makes it much easier to identify stragglers, if any, and to determine what you want to do with those stragglers.

 

My original post used the default copy behavior.  Because I suspect the possibility of stragglers I now believe the move option is better.


Brian AKA Bri the Tech Guy (website in my user profile) - Windows 10 Home, 64-Bit, Version 1803, Build 17134 

 

     In a modern society where everyone thinks their opinion deserves to be heard nothing annoys me more than individuals who mistake their personal preferences for fact.

         ~ Commenter TheCruyffGurn on the The Guardian website, 8/13/2014

 

              

 


#8 alpinemonkey

alpinemonkey
  • Topic Starter

  • Members
  • 13 posts
  • OFFLINE
  •  
  • Local time:01:50 PM

Posted 02 February 2017 - 04:53 PM

Finally got round to sorting this out.  It worked a treat!  Thanks so much for the help.  Really useful command to know about.

 

:thumbup2:






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users