Renum is a simple and efficient tool written in Go, designed to rename and renumber files in a directory. It's particularly useful for renaming series of files with a specific pattern.
- Rename files in a directory based on a specific pattern.
- Preview the changes before applying them.
- Easy to use with a simple command line interface.
renum
is available for Windows, Linux and macOS. You can download the latest version from the releases page.
To install Renum, you need to have Go installed on your machine. Once you have Go installed, you can download and install Renum using the go get
command:
go install github.com/alphayax/renum@latest
You can also use Renum with Docker. To do so, you can run the following command:
docker run --rm -it -v /path/to/directory:/data alphayax/renum:latest [options] /data
To use Renum, run the following command by passing the path to the directory containing the files you want to rename as last argument:
renum [options] /path/to/directory
-s <NUM>
,--season <NUM>
: The season number to use.-e <NUM>
,--episode <NUM>
: The episode number to start from. Will be incremented for each file.-h
,--help
: Display the help message.--force
: Don't ask for confirmation before applying the changes.--verbose
: Increase logs verbosity.--json
: Display logs in JSON format.--dry-run
: Preview the changes without applying them.--pattern <REGEX>
: Use a custom file pattern. (Will replace all the default file pattern detected)
S[0-9]+E[0-9]+
: containingS1E01
orS01E01
.[0-9]{1,2}x[0-9]+
: containing1x01
or01x01
.^E[0-9]+
: starting byE01
orE001
...[_ ][0-9]+[_ .]
: containing_01_
or_001_
or_0001_
or01
or001
...
You can use your own file pattern detection by using the
--pattern
flag with your custom regex. For example:--pattern "Season.[0-9]+.Ep.[0-9]+"
to match "Season 4 Ep 21"
Let's say you have a directory containing the following files:
[XXX-Fansub]_Xxx_Xxxxx_1086_[VOSTFR][FHD_1920x1080].xxx
[XXX-Fansub]_Xxx_Xxxxx_1087_[VOSTFR][FHD_1920x1080].xxx
[XXX-Fansub]_Xxx_Xxxxx_1088_[VOSTFR][FHD_1920x1080].xxx
To rename these files, you can run the following command:
renum --season 12 --episode 1 /path/to/directory
This will rename the files to:
[XXX-Fansub]_Xxx_Xxxxx_S12E01_[VOSTFR][FHD_1920x1080].xxx
[XXX-Fansub]_Xxx_Xxxxx_S12E02_[VOSTFR][FHD_1920x1080].xxx
[XXX-Fansub]_Xxx_Xxxxx_S12E03_[VOSTFR][FHD_1920x1080].xxx
To run the tests for Renum, navigate to the project directory and run the following command:
go test ./...
Contributions are welcome! Please feel free to submit a Pull Request.
Feel free to send crypto donations to the following addresses:
- Solana (SOL):
HUC9MmKR6iCtxu25h8hsgnVqXzeQMTK9ThQSLMFYNJBC
- Ethereum (ETH):
0xc12Ef701Dd7e5060f441b30fE569D8D7E8a230a7
- Bitcoin (BTC):
bc1qv7g3d8u9svn4w0pzfjafa7jzyglwjfkzjuc73g