Skip to main content

Zero pad numeric filenames

Project description

padio

Zero pad numeric filenames

Turn a bunch of files like this:

file1.txt
file10.txt
file5.txt

and want them to be sorted like this:

file01.txt
file05.txt
file10.txt

you can run:

padio *.txt

Installation

pip install padio

Usage

usage: padio [-h] [-l LENGTH] [-f] [-v] [-d] [-i REGEX] [--ignore-files IGNOREFILE [IGNOREFILE ...]] file [file ...]

Pads numbers in file names so they consistently align and sort

positional arguments:
  file                  Files to be renamed

optional arguments:
  -h, --help            show this help message and exit
  -l LENGTH, --length LENGTH
                        Length of numbers after padding (default: auto)
  -f, --force           Force rename, even if file at destination exists
  -v, --verbose         Print all actions
  -d, --dry-run         Print actions only without modifying any file. Implies --verbose
  -i REGEX, --ignore REGEX
                        Regular expression used to ignore files matching the name
  --ignore-files IGNOREFILE [IGNOREFILE ...]
                        Files to ignore for renaming. Must add -- before positional arguments

Original repo

Originally hosted at https://git.iamthefij.com/iamthefij/padio.git

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

padio-1.0.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

padio-1.0.1-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page