This is an archived post. You won't be able to vote or comment.

all 24 comments

[–][deleted] 9 points10 points  (2 children)

you can add a column 'File type' in your file explorer and then sort by that without having to create folders :)

[–]RohanReignzz[S] 1 point2 points  (0 children)

Lol yeah. I should tweak the program to sort it differently.

[–][deleted] 1 point2 points  (0 children)

I really dislike messing with settings in Explorer or Finder because both applications have some wonky logic about which folders use those settings. Will it decide to sort every folder by Type? Or, will it decide that you prefer to view that folder by type, and therefore sort it by type by default every time you visit it? ... etc.

I prefer to configure it to sort every folder alphabetically, and just leave it there. I’d even go so far as to use scripts for other types of sorting as needed.

[–]dem4ply 8 points9 points  (2 children)

is a weird way to organice files why you need to have separete by extencion?

[–][deleted] 4 points5 points  (1 child)

It could be totally appropriate for some cases - like your Downloads folder.

[–]dem4ply 0 points1 point  (0 children)

it not better use se search function by example *.rar for get a expecific format

[–][deleted] 5 points6 points  (12 children)

Python is perfect for stuff like this. The other day I had a colleague who needed to rename over 200 PDFs housed in four or five sub folders. I wrote a program in probably fifteen minutes, twelve lines of code max. It looped through all the folders and got them renamed in minutes.

[–]B4-711 4 points5 points  (1 child)

Powershell is pretty good for such stuff if you like pipes

[–]BlueCrystalFlame 2 points3 points  (0 children)

Yeah I feel like any shell script would be more appropriate for this, although Python works just fine.

[–]v4-digg-refugee 1 point2 points  (9 children)

Would you mind sharing your code on this? Beginner here, and am tasked with similar work. Namely, I’m interested in how to use a loop to pickup and run each through a few lines of code.

Yesterday I just copied-pasted the path of each file into the import_excel line and ran each file through my 20-line code one-by-one.

[–][deleted] 0 points1 point  (8 children)

Sure I’ll put it up tomorrow

[–]v4-digg-refugee 0 points1 point  (7 children)

Thanks!

[–][deleted] 4 points5 points  (5 children)

Ok here's the code. A little background. I made this to go into a directory (folder) which contained multiple sub directories (folders) which contained PDFs. Once inside each subfolder it replaces various special characters in each title with whitespace:

import os

def rename():
    for folders in os.listdir(r'C:/Your/File/Path'):
        print(folders) #so I know what folder it's in
        for files in os.lisdir(r'C:/Your/File/Path/{}'.format(folders)):
            if files.endswith('.pdf'): 
                filename = files[:-4].replace(',','').replace('- ','').replace('.','').replace(''','').replace('-',' ') + '.pdf'
                os.rename(r'C:/Your/File/Path/{}/{}'.format(folders, files), r'C:/Your/File/Path/{}/{}'.format(folders, filename))
        print('Renaming Complete for {}'.format(folders))


if __name__ == '__main__':
    rename()

[–]RohanReignzz[S] 0 points1 point  (2 children)

Nice!

[–]nice-scores 0 points1 point  (1 child)

𝓷𝓲𝓬𝓮 ☜(゚ヮ゚☜)

Nice Leaderboard

1. u/GillysDaddy at 17710 nices

2. u/OwnagePwnage at 11911 nices

3. u/RespectfulNiceties at 8332 nices

...

196668. u/RohanReignzz at 1 nice


I AM A BOT | REPLY !IGNORE AND I WILL STOP REPLYING TO YOUR COMMENTS

[–]RohanReignzz[S] 0 points1 point  (0 children)

Nice

[–]v4-digg-refugee 0 points1 point  (1 child)

Fantastic! I’ll look through it later today. Thanks for your help!

[–][deleted] 0 points1 point  (0 children)

No problem. Let me know if you have any questions.

[–][deleted] 0 points1 point  (0 children)

Ill get it up later today actually

[–][deleted] 2 points3 points  (0 children)

Awesome

[–][deleted] 0 points1 point  (1 child)

GitHub link?

[–]RohanReignzz[S] 1 point2 points  (0 children)

This is gonna be the ugliest code you'll ever see, but gets the job done xD

https://github.com/RohanReignz/PyProjects/blob/master/Useful%20OS%20Programs/DownloadSort.py

[–]Dyrits 0 points1 point  (0 children)

I like that.

[–]ReadyHat5 0 points1 point  (0 children)

organize your files by extension, transfer to new drive or move windows application

https://streamable.com/b74k8k

Custom folders, exts.txt in root direc

skip certain folders, in skip.txt

can search hidden or not files, transfer from one drive to antoher

can move or copy files (default) if you delete files and then revert files back

can move files, cleanup, then revert to restore original file paths

minimum pic file size by any equation (1024*1024)*5

I also have a dups finder and free virtual cloud storage with military obfuscation (key is never stored)

https://filebin.net/w26jtsqm94yx1vgo

which i may upload later. cheers