Page 1 of 1

How can I remove trailing underscores from file names?

PostPosted: Mon Apr 22, 2024 2:10 pm
by gwswicord
Hi. I have a large set of files that use _ to avoid problems caused by spaces in filenames. How can I remove _ as the last character without removing the underscores between words in the filenames?

Remove ending underscore(s)

PostPosted: Mon Apr 22, 2024 7:18 pm
by Luuk
If its always just 1-underscore, Replace(3) can use a "Replace" like \end\_

If can be 1-or-more, then RegEx(1) can use a "Match" and "Replace" like...
(.+?)_+$
\1

Re: How can I remove trailing underscores from file names?

PostPosted: Tue Apr 23, 2024 11:51 am
by gwswicord
Thanks, Luuk! That did the trick. :)