Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8180843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:19:43+00:00 2026-06-07T00:19:43+00:00

I want to implement a simple script to do some boring housekeeping on my

  • 0

I want to implement a simple script to do some boring housekeeping on my media pc, but am not sure what scripting language would lend itself to this task.

Pseudocode for what I want to do is:

1) Scan a directory for sub directories matching a name like:

"Foo 1x01 bar"
"Foo 1x02 bar"
or 
"Foo s01e01 bar"
"Foo s01e02 bar"



2) Then for each matching sub directory:
  - Make a directory "Foo" if it doesn't already exist.
  - Copy the largest file under the matching sub directory into "Foo".
  - Delete the matched sub directory and anything left in it.

That’s it. Although I might want to extend it to do more over time. Any suggestions for the most elegant scripting tool to use for this task?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:19:45+00:00Added an answer on June 7, 2026 at 12:19 am

    I’d recommend Python, as you stated that you want to use it on your Mac too.
    Using the the shutil and os modules (look at os.walk), it should be pretty easy.
    here’s an example that gets the size of all of the files starting from the folder in the top variable.

    import os
    from os.path import join, getsize
    for root, dirs, files in os.walk('python/Lib/email'):
        print root, "consumes",
        print sum(getsize(join(root, name)) for name in files),
        print "bytes in", len(files), "non-directory files"
        if 'CVS' in dirs:
            dirs.remove('CVS')  # don't visit CVS directories
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to implement a simple specialized window manager for presentations (not user-controllable) that
I want to implement something with jquery, simple javascript and java but I don't
I want to use List.Find() on a simple collection that does not implement Find().
I want to implement highcharts in ruby on rails. But there's some runtime problem
I want to implement C# as the scripting language in my game. My problem
I want to implement simple LINQ-to-SQL-like functionality in my .net application. For example i
I want to implement a simple link that when clicked, deletes the item from
I want to implement something simple like /System/Workflows/Sample Workflow with the small addition of
I want to implement a simple application (modification of sample2) which is showing what
Basically I want to implement a simple Rails extension to define the seriousness of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.