Advertisement

08.17.2008 at 06:15PM PDT, ID: 23655220
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.6

Moving files to sub-dirs based on extenstion

Asked by jmohsin in Perl Programming Language

Tags:


I need a Perl script to do the following...

1. I have a collection of 1000000+ audio and video files scattered under a directory called c:\Rawfiles.  I would like to run a Perl script that does the following...

2. Search for ALL audio and video files located in this directory named c:\Rawfiles AND underneath this c:\Rawfiles directory and move them to sub-directories named on the file extension.  Thus, all .mp3 files go into a sub-dir named c:\Rawfiles\mp3, .avi got into a sub-dir named c:\Rawfiles\avi and so on.

3. The sub-dirs named after the audio-video file extensions may or may not pre-exist in a directory.  Some of the audio video files I have seen are: .mp3, .asf, .mp4, .m4v, .mov, .avi, .wmv, .mpg, .mpeg, .rax.

4. There may be many, many sub-directories under c:\Rawfiles that may have further sub-directories that are NOT named after the audio video extension names.  The script should traverse down into such directories and search for audio-video files and move all the audio video files to c:\Rawfiles\avi,  c:\Rawfiles\mp3, c:\Rawfiles\mpg and so on...

5. At the end of he script run, there will be directories named c:\Rawfiles\avi,  c:\Rawfiles\mp3, c:\Rawfiles\mpg and so on located (of course) under c:\Rawfiles.  None of these directories named after the audio video file extensions should be empty, if an empty audio video directory is found anywhere (it probably pre-existed) with no files in it, such a directory should be deleted.

6. IMPORTANT: It should be possible to run the script multiple times, as files are added under c:\Rawfiles continually.

Please ask if you have any questions.Start Free Trial
[+][-]08.18.2008 at 05:36AM PDT, ID: 22251187

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Tags: Moving files sub-directories based extenstion Perl
Sign Up Now!
Solution Provided By: nedfine
Participating Experts: 2
Solution Grade: A
 
 
[+][-]08.18.2008 at 06:44AM PDT, ID: 22251728

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_Related_20080208