Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Renames files that share a common prefix and suffix in a directory.

License

Notifications You must be signed in to change notification settings

joshuacrotts/batch-file-renamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Batch File Renamer

CodeFactor GitHub contributors GitHub commit activity GitHub repo size GitHub issues open GitHub issues closed

Have you ever had a list of files in a directory that you wanted to rename all at once, but couldn't find the necessary bash or terminal commands to do so? Well, this Python script has you covered! Sure, it's a very narrow use-case, but it works! For instance, when I download and splice spritesheets, very often I find myself having to go through and rename every file to have a common, no padded-zero prefix (e.g. tile_009.png, tile_010.png... this just screws up my whole day!).

Usage

To use this, open your terminal/Python shell, and use the following format to execute the program:

python main.py /path/to/dir/ old_file_prefix desired_file_prefix .file_extension padded_zero_count

Example:

python main.py C:\Users\Joshua\Downloads\test\ tile_0 frame_ .png 2

The above command will rename all files with the prefix tile_0, and 2 successive padded zero integers (i.e. tile_010, tile_020, tile_033, etc.) to frame_i, where i is an integer between 0 and n, where n is the number of files in the directory.

Dependencies

The only dependency for this project is Python 3.8.

Reporting Bugs

See the Issues Tab.

About

Renames files that share a common prefix and suffix in a directory.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages