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

[Question] Custom when fix conflicts #47

Closed haunt98 closed 3 months ago

haunt98 commented 1 year ago

For example currently fixing conflicts mean adding (2), (3), ... to filename

Can I change to _01, _02, ...

Because for some reason I don't want space in filename.

ayoisaiah commented 1 year ago

This is not possible right now, but I will consider adding this in the next release

ayoisaiah commented 5 months ago

@haunt98 https://github.com/ayoisaiah/f2/commit/f8542dc51ada09a64a6275b1fc3b76f857348cac

I've added the --fix-conflicts-pattern flag so you can do something like:

f2 -r 'myfile.txt' -F --fix-conflicts-pattern '_%02d' 

This gives you _01, _02 etc. Please see the latest nightly release

haunt98 commented 5 months ago

I tried and it's looking good

image

Thanks @ayoisaiah !

haunt98 commented 5 months ago

Hi @ayoisaiah , I think there is an regression.

I try to run f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{xt.ImageSize}{ext}" --fix-conflicts --fix-conflicts-pattern '_%02d' --exec 2 times but the result is not the same.

image

Upper is first run, lower is second run.

ayoisaiah commented 3 months ago

It's fixed now:

image

haunt98 commented 3 months ago

Thanks @ayoisaiah :D