How to delete Leading or Trailing Spaces?

If you need help on how to use the program
Post Reply
Ray
Posts: 2
Joined: 2014-03-06 10:03:31

How to delete Leading or Trailing Spaces?

Post by Ray »

Hey There,

I love this Tool! But I'm having one issue, I can't seem to find a way to remove Leading or Trailing Spaces without deleting any text from folders/files if anyone knows how please let me know!


Example
_____________________________
From:

Hello .txt
Hello 2.txt

To:

Hello.txt
Hello 2.txt
_____________________________


Thanks

Ray :)
antp
Site Admin
Posts: 9712
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Hi,
Using the "regular expression" action you could do that easily.

Expression = (.+)\s\.([^\.]+)
New Name = $1.$2

The expression searches for :
- any character (1 or more) -> the base name
- at least a space
- a dot
- any character (1 or more) except a dot -> the extension

New name is generated with the two parts between parenthesis (base name & extension)

Check using the preview fonction before renaming, to be sure it works in all cases ;)
Ray
Posts: 2
Joined: 2014-03-06 10:03:31

Post by Ray »

Hey antp,


Thanks for the reply I really appreciate it. That expression worked like a charm and for the explanation as well. I wish I understood expressions better, it would help me out a lot.

Though as side note, it would be awesome to see this as a preset feature in the possible future for new people like me.


Thanks,

Ray :wink:
antp
Site Admin
Posts: 9712
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Yes that's something I should add, some presets-expressions for ordinary tasks. But as many things on my to-do list... they tend to stay on the to-do list :lol:
Post Reply