[Python] How to move files from current path to a specific folder named like or similar to the...

Discussão em 'Python' iniciado por Stack, Maio 29, 2025.

  1. Stack

    Stack Membro Participativo

    My Folder Structure looks like this:

    - 95000
    - 95002
    - 95009
    - AR_95000.pdf
    - AR_95002.pdf
    - AR_95009.pdf
    - BS_95000.pdf
    - BS_95002.pdf
    - BS_95009.pdf


    [Note 95000, 95002, 95009 are folders]


    My goal is to move files AR_95000.pdf and BS_95000.pdf to the folder named 95000, then AR_95002.pdf and BS_95002.pdf to the folder named 95002 and so on.

    The PDFs are reports generated by system and thus I can not control the naming.

    Continue reading...

Compartilhe esta Página