Page 1 of 1

How to delete Leading or Trailing Spaces?

Posted: 2014-03-06 10:12:00
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 :)

Posted: 2014-03-06 13:03:22
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 ;)

Posted: 2014-03-06 13:19:23
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:

Posted: 2014-03-06 14:43:46
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: