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

Latest commit

 

History

History
27 lines (14 loc) · 1.99 KB

README.md

File metadata and controls

27 lines (14 loc) · 1.99 KB

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.