ayoisaiah / f2

F2 is a cross-platform command-line tool for batch renaming files and directories quickly and safely. Written in Go!
https://f2.freshman.tech
MIT License
866 stars 38 forks source link

Recursive indexing doesn't reset count per folder #70

Closed Imasake closed 3 months ago

Imasake commented 5 months ago

I'm trying to recursively rename all files in a directory with a lot of subfolders which all have images inside with this command:

f2 -r '{1p}_{%02d}{ext}' -R

I expect the output to be like this:

folder1/folder1_01
folder1/folder1_02
folder2/folder2_01
folder2/folder2_02

But the actual result is:

folder1/folder1_01
folder1/folder1_02
folder2/folder2_03
folder2/folder2_04

The number keeps going up between folders.

I don't know if I should issue this as a bug or an enhancement, but I would like to know if there's a way to index all files recursively and make the count reset per folder.

ayoisaiah commented 3 months ago

@Imasake What you described is the expected behaviour, but I've just added a --reset-index-per-dir option to achieve what you're seeking:

image