Skip to content

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

License

Notifications You must be signed in to change notification settings

IgorZyktin/numerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages