Page 1 of 1

How to remove a trailing space in the filename

PostPosted: Sun Oct 01, 2023 4:55 am
by Trickyt57
Your file name looks like this? "Bank statement .pdf". You want to get rid of the trailing space between the word "statement" and ".pdf", but you want to retain the space between "Bank" and "statement".

If you wish to remove a leading space (instead of a trailing space), in the file name, you will be able to easiily do it once you understand the below procedure.

You need the "Full Name" condition and the "Rename" action.
Your rule is going to look like this:
Image
In the image above, I have created a custom token called "Start of file name".
You will notice above that that in the "match" condition there is a space before the ".pdf"

Here is how you create the custom token.

Click on "Custom Text" as per the image below
Image

Give it a name as per the image below. I called the token "Start of filename"
Image

Click on "Anything" as per the image below.
Image
now click "Done" twice.

Next add the "space" followed by .pdf. like this:
Image

Finally under "Full Name matches" click the token "Start of filename", followed by ".pdf" as below.
Image

Click "Done", and run your rule. It will remove any trailing space in the monitored folder.

I assumed that the file name ends in ".pdf". If you want to do the same for any extension simply replace ".pdf" with the token "extension" as shown in the first photo above.

Re: How to remove a trailing space in the filename

PostPosted: Tue Mar 05, 2024 11:02 pm
by Grasshopper
I cannot see any of your pasted images. Only see a broken icon. Could you fix somehow?
BTW I needed to do this, so I had resorted to using another tool called A Better Finder Rename.