Multi-rename tool: how to remove first N or last N chars
Moderators: Hacker, petermad, Stefan2, white
-
- Junior Member
- Posts: 8
- Joined: 2015-07-21, 11:01 UTC
Multi-rename tool: how to remove first N or last N chars
Hi there,
it would be nice if you could remove first N or last N chars from filename...
I only found an option to select a range of chars from filename but nothing regarding what I said above.
What do you think about that?
it would be nice if you could remove first N or last N chars from filename...
I only found an option to select a range of chars from filename but nothing regarding what I said above.
What do you think about that?
It's in the help:
Dalai
RegardsTC help, opened with F1 in the MRT dialog wrote:[...]
[N-8,5] 5 characters starting at the 8-last character (counted from the end of the name)
[N-8-5] Characters from the 8th-last to the 5th-last character
[N2--5] Characters from the 2nd to the 5th-last character
[N-5-] Characters from the 5th-last character to the end of the name
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Multi-rename tool:remove first N or last N chars
Hi and welcome.
Examples:
Rename mask: file name
Remove first 3 chars from file name (start at 4th): [N4-]
TOTALCMD.EXE >> ALCMD.EXE
Remove last 3 chars from file name (first till 4th-last): [N1--4]
TOTALCMD.EXE >> TOTAL.EXE
Remove first 3 chars AND last 3 chars from file name: [N4--4]
TOTALCMD.EXE >> AL.EXE
HTH?
What Dalai says.thepearlsmaster wrote:it would be nice if you could remove first N or last N chars from filename...
Examples:
Rename mask: file name
Remove first 3 chars from file name (start at 4th): [N4-]
TOTALCMD.EXE >> ALCMD.EXE
Remove last 3 chars from file name (first till 4th-last): [N1--4]
TOTALCMD.EXE >> TOTAL.EXE
Remove first 3 chars AND last 3 chars from file name: [N4--4]
TOTALCMD.EXE >> AL.EXE
HTH?
-
- Junior Member
- Posts: 8
- Joined: 2015-07-21, 11:01 UTC
Re: Multi-rename tool: how to remove first N or last N chars
[this thread is the only result for 'delete last character, so, to expand the theme-]
How can you make it conditional, e.g. if the last character is a space, delete it?
I suspect it's a job for regex.
Thx.
How can you make it conditional, e.g. if the last character is a space, delete it?
I suspect it's a job for regex.
Thx.
Regards, PhredE
Re: Multi-rename tool: how to remove first N or last N chars
Yes, try RegExPhred wrote: 2019-04-11, 09:35 UTC How can you make it conditional, e.g. if the last character is a space, delete it?
Search: \s$
Replace: <Clear>
[_]E
[x]RegEx
Search: \s$ ==> the last character is a space
Search: \s+$ ==> the last few characters (one-or-more) may be a space
Instead of the RegEx Meta char "\s", you can also enter a real space sign.
You can try this with any sign, like delete only the last 'e' by using: Search: e$
Press F1-key in MRT and then click on "RegEx Now supports regular expressions." if you want to know more about.
HTH?
Re: Multi-rename tool: how to remove first N or last N chars
[kisses] 
That's certainly it. [space] and [end of line] ==> \s and $ ==> \s$
I've learned that RegEx is a duo: Search for something and Replace the result with something else.
I note that [_] is a blank, reset, tick-box, and [x] is a chosen, set, box.
I'm curious that [_] E is required so as not to refer to the file(s) extensions. Hovering over the E reports 'Replace also in file extensions, while clearing it makes the dialog box refer to only the filename; setting it includes the extension - therefore, IMO, the hover-prompt is WRONG: it should say:
'AND find & replace also in file extensions'. Setting it refers to BOTH, not exclusively the filename OR (xor) the extension: the condition has to qualify for BOTH parts of the filename.extension for the action to obtain.
Comment Author Ghisler?
I also note that on my screen the E is closer the to RegEx tick-box than to its own.*
I'm a 'small steps' learner, I'm afraid, taking a feature and learning how to use it with examples, then expanding that knowledge with another related small step.
The TC RegEx Help 'dictionary' is a bit too bland for me. I once saw a site that gave realtime results of typed expressions, but a gradual explanation and testing process with examples and over-teaching would have been more welcome. A slow tutorial I shall find.
Does That Help? It certainly does.
Yours in persistence,
Thx.

That's certainly it. [space] and [end of line] ==> \s and $ ==> \s$
I've learned that RegEx is a duo: Search for something and Replace the result with something else.
I note that [_] is a blank, reset, tick-box, and [x] is a chosen, set, box.
I'm curious that [_] E is required so as not to refer to the file(s) extensions. Hovering over the E reports 'Replace also in file extensions, while clearing it makes the dialog box refer to only the filename; setting it includes the extension - therefore, IMO, the hover-prompt is WRONG: it should say:
'AND find & replace also in file extensions'. Setting it refers to BOTH, not exclusively the filename OR (xor) the extension: the condition has to qualify for BOTH parts of the filename.extension for the action to obtain.
Comment Author Ghisler?
I also note that on my screen the E is closer the to RegEx tick-box than to its own.*
I'm a 'small steps' learner, I'm afraid, taking a feature and learning how to use it with examples, then expanding that knowledge with another related small step.
The TC RegEx Help 'dictionary' is a bit too bland for me. I once saw a site that gave realtime results of typed expressions, but a gradual explanation and testing process with examples and over-teaching would have been more welcome. A slow tutorial I shall find.
Does That Help? It certainly does.
Yours in persistence,
Thx.
Regards, PhredE
-
- Junior Member
- Posts: 17
- Joined: 2021-03-04, 10:26 UTC
Re: Multi-rename tool: how to remove first N or last N chars
Hello.
Can someone help me to find the right settings:
I want to find the first ")" in the folder names and delete all the Rest.
Example:
Abcde (2019)_BlaBla-and-Bla
Xyz (2021).Dudeldu-delduu
should become
Abcde (2019)
Xyz (2021)
Thank u
Can someone help me to find the right settings:
I want to find the first ")" in the folder names and delete all the Rest.
Example:
Abcde (2019)_BlaBla-and-Bla
Xyz (2021).Dudeldu-delduu
should become
Abcde (2019)
Xyz (2021)
Thank u

Re: Multi-rename tool: how to remove first N or last N chars
Search for: )*
Replace with: )
[E] checked and RegEx unchecked.
Replace with: )
[E] checked and RegEx unchecked.
-
- Junior Member
- Posts: 17
- Joined: 2021-03-04, 10:26 UTC
Re: Multi-rename tool: how to remove first N or last N chars
wow... thank u very much !!!
quick and absolutely right
works like a charme !!
THANK U !!!
quick and absolutely right

works like a charme !!
THANK U !!!
Re: Multi-rename tool: how to remove first N or last N chars
In the multi-rename tool press F1 to open the help and scroll down to the description of the Placeholdersg200 wrote: I would like to know how to remove the last N characters from a file name.
[N-X-] where is your N should do the trick.
HTH
Hoecker sie sind raus!