remove last character with multi-rename tool
Moderators: white, Hacker, petermad, Stefan2
remove last character with multi-rename tool
Dear Forum Members,
I am working on a digital archive pre-ingest, my question is as follows:
How can i remove the '_' that are written at the end of my files?
Current filename:
wico_flyer_03_.txt
Desired filename:
wico_flyer_03.txt
I tried working with the [N] placeholders, but can't figure out how to make them useful for this scenario.
The problem is that there are many, many different filenames that end with a '_', I am looking for an effective, time saving solution.
Would greatly appreciate if you know something to help me out !
I am working on a digital archive pre-ingest, my question is as follows:
How can i remove the '_' that are written at the end of my files?
Current filename:
wico_flyer_03_.txt
Desired filename:
wico_flyer_03.txt
I tried working with the [N] placeholders, but can't figure out how to make them useful for this scenario.
The problem is that there are many, many different filenames that end with a '_', I am looking for an effective, time saving solution.
Would greatly appreciate if you know something to help me out !
Re: remove last character with multi-rename tool
Hi koekje12,
HTH
Roman
Code: Select all
[N1--2]
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Re: remove last character with multi-rename tool
Hello Roman,
Thanks for your reply!
My apologies, I haven't been very clear in my question, there are also many files with no '_' at the end of their name.
Now I end up removing their names as well, is there any function to only remove the last character when it is a '_' ?
Appreciate the help!
Kind regards
Thanks for your reply!
My apologies, I haven't been very clear in my question, there are also many files with no '_' at the end of their name.
Now I end up removing their names as well, is there any function to only remove the last character when it is a '_' ?
Appreciate the help!
Kind regards
Re: remove last character with multi-rename tool
FROM:
wico_flyer_03_.txt
wico_flyer_04.txt
TO:
wico_flyer_03.txt
wico_flyer_04.txt
USE:
- select all files
- press Ctrl+M
in MRT:
Search for: _$
Repalce: <Clear>
[_]E
[x]RegEx
Explanation:
- [_]E == Don't work on the file extension but on the base name only
- [x]RegEx == Enable Regular Expression
- Search for "_" at the end of the string ( "$" == regex Line Boundary: match at end of line)
- Replace with nothing (so remove it)
More:
https://www.ghisler.ch/wiki/index.php/Regular_Expressions
https://regex.sorokin.engineer/en/latest/regular_expressions.html
https://regex.sorokin.engineer/de/latest/regular_expressions.html
wico_flyer_03_.txt
wico_flyer_04.txt
TO:
wico_flyer_03.txt
wico_flyer_04.txt
USE:
- select all files
- press Ctrl+M
in MRT:
Search for: _$
Repalce: <Clear>
[_]E
[x]RegEx
Explanation:
- [_]E == Don't work on the file extension but on the base name only
- [x]RegEx == Enable Regular Expression
- Search for "_" at the end of the string ( "$" == regex Line Boundary: match at end of line)
- Replace with nothing (so remove it)
More:
https://www.ghisler.ch/wiki/index.php/Regular_Expressions
https://regex.sorokin.engineer/en/latest/regular_expressions.html
https://regex.sorokin.engineer/de/latest/regular_expressions.html
Re: remove last character with multi-rename tool
This should work:
Search for:
Replace with:
[ ] E
[X] RegEx
2Stefan2:
This will replace all underscores, not just the last one.
Search for:
Code: Select all
(.+)_$
Code: Select all
$1
[X] RegEx
2Stefan2:
This will replace all underscores, not just the last one.
#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
Re: remove last character with multi-rename tool
Thank you, your were right for "_?", but I already had adjusted my mistake (typo) while you were typing
Re: remove last character with multi-rename tool
Thanks to both of you, it worked
Are there any resources where one can learn to use these '(.+)_$' commands?
Are there any resources where one can learn to use these '(.+)_$' commands?
Re: remove last character with multi-rename tool
2koekje12
When the MRT is open press F1 to open the help and look for regular expressions. There's a dedicated page in TC help about it. Also see the resources linked by Stefan2.
When the MRT is open press F1 to open the help and look for regular expressions. There's a dedicated page in TC help about it. Also see the resources linked by Stefan2.
#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
Re: remove last character with multi-rename tool
I see, thank you!