[Python] Group files using regular expressions [closed]

Discussão em 'Python' iniciado por Stack, Junho 28, 2025.

  1. Stack

    Stack Membro Participativo

    I have a large set of files with filenames that contains version numbers in them. Such as:

    FileBam-0.1.1.zip
    FileBam-0.1.2.zip
    FileBoozle-1.7.4.zip
    FileBoozle-1.7.5.zip
    FileBoozle-1.7.6.zip
    FileWam-0.97.40.zip
    OtherFile-5.5.zip


    I'd like to make a script in Python or PowerShell, to group them by name so that I can find the ones with multiple versions, and archive and/or delete all but the latest version. I would settle for a list of which filenames to check, since not very many of them have multiple versions, but the total number of files is too large to simply scroll through manually.

    I am not even sure where to start, I'm not up-to-date on either language. If there is a free tool for doing this, then that's even better!

    Continue reading...

Compartilhe esta Página