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.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

numerator-1.0.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file numerator-1.0.0.tar.gz.

File metadata

  • Download URL: numerator-1.0.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for numerator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2e0df17241f38efcbc10e85bf815636047fc6a29647c067757a4fb1afe458670
MD5 5e1f3c68ba24c06cf5d4f5d47b1111ef
BLAKE2b-256 995390331376fdf705c9d6ce99cee8768ef4763368ffad1293c17bc7d1cfc25f

See more details on using hashes here.

File details

Details for the file numerator-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: numerator-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for numerator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58e6cd894ca00ff8ba0018ac1a6e80de7d9096cb0fe4ae6378cf6ec06e2f077f
MD5 ca46bc2c74ed3ee2aaa172921f114142
BLAKE2b-256 3f442c07697b8e7bebf5b713183e4a2f121b42af3a90b2fcfcaf9959ad9a8229

See more details on using hashes here.

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