You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, brename performs global replacement (with /g switched on).
Since you want to replace the first two "_", it can't be done by just disabling global replacement.
One way is there:
$ brename -p '^([^_]+)_([^_]+)_(.+)' -r '${1} - ${2} - ${3}' -d
Searching for paths to rename...
[OK] Filename_02_description_02.txt -> Filename - 02 - description_02.txt
1 path(s) to be renamed
Thank you for the answer. What about if it just the first one or if there are many x ones, it will be possible to implement a dedicated switch to make it easier?
Hi there. I was playing around with this and i can't find a way to select just the desidered matches only. Let me make some examples about this:
I would like to replace just the first "_" with something else, for example " - " so it will be renamed to
Filename01 - description_01
I would like to replace just the first two "_" with " - " so it will be renamed to:
Filename - 02 - description_02 and so on.
With regex if you want to match just the first "_" you just remove the /g from the expression but this doesn't work in brename
this command:
brename -p "_" -r " - "
replace all the founds "_" into " - "
The text was updated successfully, but these errors were encountered: