Skip to main content

Script that automatically renames files, so they get equally zero left padded names

Project description

numerator

Script that automatically renames files, so they get equally zero left padded names.

Usage

Imagine you have this folder:

PS C:\test> ls

    Directory: C:\test

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          16.12.2022    15:17              0 file-090.jpg
-a---          16.12.2022    15:17              0 file-1.jpg
-a---          16.12.2022    15:17              0 file-100.jpg
-a---          16.12.2022    15:17              0 file-5.jpg
-a---          16.12.2022    15:17              0 file-80.jpg
-a---          16.12.2022    15:17              0 info.txt

And you want all files named "file-XXX.jpg" (except for the "info.txt").

Checking possible renames without actual changes:

pip install numerator
cd C:\test
numerator --dry-run
Renaming 6 files to padding 3
"C:\test"
	1. Planning to rename 'file-1.jpg' to 'file-001.jpg'
	2. Planning to rename 'file-5.jpg' to 'file-005.jpg'
	3. Planning to rename 'file-80.jpg' to 'file-080.jpg'

Actual renaming operation:

cd C:\test
numerator
Renaming 6 files to padding 3
"C:\test"
	1. Renamed 'file-1.jpg' to 'file-001.jpg'
	2. Renamed 'file-5.jpg' to 'file-005.jpg'
	3. Renamed 'file-80.jpg' to 'file-080.jpg'

Contents of the folder after execution:

PS C:\test> ls

    Directory: C:\test

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          16.12.2022    15:17              0 file-001.jpg
-a---          16.12.2022    15:17              0 file-005.jpg
-a---          16.12.2022    15:17              0 file-080.jpg
-a---          16.12.2022    15:17              0 file-090.jpg
-a---          16.12.2022    15:17              0 file-100.jpg
-a---          16.12.2022    15:17              0 info.txt

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

numerator-1.0.1.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

numerator-1.0.1-py3-none-any.whl (6.5 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