Crates.io | wrench |
lib.rs | wrench |
version | 0.1.0 |
source | src |
created_at | 2024-11-23 02:51:55.467474 |
updated_at | 2024-11-23 02:51:55.467474 |
description | Rename files matching a regular expression by replacing parts of their name |
homepage | https://github.com/funnyboy-roks/wrench |
repository | |
max_upload_size | |
id | 1458201 |
size | 24,364 |
A command-line tool for mass-renaming of files from one pattern to another using regular expressions.
$ ls
'Episode 1 - Hello.mkv' 'Episode 2 - World.mkv' 'Episode 3 - How.mkv' 'Episode 4 - Are.mkv' 'Episode 5 - You.mkv'
'Episode 1 - Hello.srt' 'Episode 2 - World.srt' 'Episode 3 - How.srt' 'Episode 4 - Are.srt' 'Episode 5 - You.srt'
$ wrench '^Episode (\d+).*\.' 'S01E0$1.' *
'Episode 1 - Hello.mkv' -> 'S01E01.mkv'
'Episode 1 - Hello.srt' -> 'S01E01.srt'
'Episode 2 - World.mkv' -> 'S01E02.mkv'
'Episode 2 - World.srt' -> 'S01E02.srt'
'Episode 3 - How.mkv' -> 'S01E03.mkv'
'Episode 3 - How.srt' -> 'S01E03.srt'
'Episode 4 - Are.mkv' -> 'S01E04.mkv'
'Episode 4 - Are.srt' -> 'S01E04.srt'
'Episode 5 - You.mkv' -> 'S01E05.mkv'
'Episode 5 - You.srt' -> 'S01E05.srt'
$ ls
S01E01.mkv S01E01.srt S01E02.mkv S01E02.srt S01E03.mkv S01E03.srt S01E04.mkv S01E04.srt S01E05.mkv S01E05.srt