Skip to content

Add leading zeros to file name to keep them in order #463

@abe-101

Description

@abe-101

A neat little python script can add leading zero's to all the file names this way they will appear in order.
Something like this:

import sys,os,re

for file in sys.argv[1:]:
    if __file__ in file: continue
    number, name = file.split('-', 1)
    number = '{:0>4}'.format(number)
    new_name = f'{number}-{name}'
    os.rename(file,new_name)

PR #335 is the result of the above program.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions