Can I only delete gaps in certain places?

Advanced Renamer forum
#1 : 28/08-24 20:44
Baki UÄŸur
Posts: 14
I have a lot of files. There is an @ sign in these file names. But to the right and left of this @ sign, sometimes there are spaces and sometimes there are no spaces. I want to put one space to the right and left of it in a regular way.

Examples;

1 : Xxxxx xxxxx @xxxx to Xxxxx xxxxx xxxxx @ xxxx
2 : Xxxxx xxxxx @ xxxx to Xxxxx xxxxx @ xxxx
3 : Xxxxx xxxxx@xxxx to Xxxxx xxxxx @ xxxx

The names of my files are mixed up like this. I'd like to tidy it up. I'd appreciate your help.
#2 : 28/08-24 21:08
Delta Foxtrot
Posts: 296
Reply to #1:

Hi Baki,

That shouldn't be a problem. You just need a regular expression that says, in effect, "locate each @ sign, any (optional) spaces around it, and replace with <space>@<space>."

It looks like this (don't include the square brackets, they are just there to show spaces):

REPLACE method:
Replace: [ *@ *]
Replace with: [ @ ]
ALL occurrences
Case sens: doesn't matter
Use regular expressions: YES
Apply to: Name

Screenshot:
https://drive.google.com/file/d/1E_DggZOib8EhsUa ii4ERZH_figU0uaw8/view?usp=sharing

(I had to add numbers to your example filenames to avoid errors, but you get the idea I'm sure)

Piece o' cake, my friend.
Best,
DF

#3 : 29/08-24 01:45
Baki UÄŸur
Posts: 14
Reply to #2:

There are 2 problems. The first one is that I get an error in your suggestion and the files to be translated appear red. I also tried [*@*] in parentheses, but only the red warning goes. It doesn't solve the problem when there is more than one space on the right or left or @ at the beginning or end of the word.
#4 : 29/08-24 01:58
Delta Foxtrot
Posts: 296
Reply to #3:

Hi Baki,

Well, it worked for me, as you can see in the screenshot I included. You aren't including the square brackets in the entries are you? Do you have other methods in your batch? What error message are you getting in the red?

Can you include a screenshot of your ARen method list and file list? That would help to narrow down the problem.

Best,
DF
#5 : 29/08-24 11:30
Miguel
Posts: 141
Reply to #3:
Hi Baki,
The Delta Foxtrot solution work perfectly with your examples. I will always ask to include real examples of the files.

Try this:
Replace: \s*@\s*
Replace with: @ (insert space before and after @)
Use regular expressions: YES
Apply to: Name

Miguel
#6 : 30/08-24 20:15
Baki UÄŸur
Posts: 14
Reply to #4:
I did as you said but it didn't work for me.
#7 : 30/08-24 20:17
Baki UÄŸur
Posts: 14
Reply to #5:
It worked. Thank you...