Amazing-Python-Scripts icon indicating copy to clipboard operation
Amazing-Python-Scripts copied to clipboard

A script to organise files in a folder as per their extensions

Open Rahul555-droid opened this issue 5 years ago • 7 comments

Aim

On running this script the files in an input folder(command line) will be put into a folder as per their extension

Details

Say I have a folder or a directory named "my_files" In my_files I have files of all sorts of extensions like .txt , .pdf , .epub, etc. Their numbers are in 100s Going through each file and moving it to a directory will be cumbersome so will let python do it.

This script will take a path of my_files as input from command line and will organise the folders automatically as per their extensions,

Like all the files with .pdf extension will be moved to a sub directory inside "my_files" named as "pdf" and all the files with .txt extension will be moved to a sub directory named "txt" and so on.

Rahul555-droid avatar Jan 08 '21 21:01 Rahul555-droid

Hi thanks for creating your first issue at Amazing-Python-Scripts, hope you followed the guidelines.

github-actions[bot] avatar Jan 08 '21 21:01 github-actions[bot]

Hi please assign me this issue for SWOC. Thanks :)

Rahul555-droid avatar Jan 08 '21 21:01 Rahul555-droid

Assigned to you @Rahul555-droid

avinashkranjan avatar Jan 09 '21 05:01 avinashkranjan

Thanks will do it.

Rahul555-droid avatar Jan 09 '21 05:01 Rahul555-droid

@Rahul555-droid @avinashkranjan Please let me know if I can help :)

yonMaor avatar Jan 09 '21 12:01 yonMaor

Hi abhinav I have opened the PR please review it.

Also I have used the stdin input instead of commandline arguments that I mentioned here.

Rahul555-droid avatar Jan 10 '21 17:01 Rahul555-droid

Hi @yonMaor . I am almost done here.

Maybe you can make a shell script similar to this if allowed here.

Rahul555-droid avatar Jan 10 '21 17:01 Rahul555-droid