New here: How do I...

I looked at the ACTIONS shared by some users and I think one of them may(??) do what I want but the way the solution was presented makes no sense to me as to how to implement it.

Anyway, here's what I would like to do:

  1. Replace all occurrences of two or more contiguous spaces with only one.
  2. Given the following: MADONNA-^MATERIAL GIRL (where ^ is my representation of a blank space), change it to MADONNA^-^MATERIAL GIRL
  3. Conversely, given the following: MADONNA^-MATERIAL GIRL (where ^ is my representation of a blank space), change it to MADONNA^-^MATERIAL GIRL
  4. For requests 2 & 3 above, the end result is to always have the dash character with one leading and one trailing blank space

Can someone help this novice out with very specific instructions on how to do it?

Many thanks in advance...

Use Replace with regular expression as action type:

Regular expression: \s{2,}
Replace matches with: " "

Regular expression: \s?-\s?
Replace matches with: " - "

(This would also turn MADONNA-MATERIAL GIRL into MADONNA^-^MATERIAL GIRL, if you don't want this, use (\s-|-\s) as expression)

Thanks for your reply...

Your first expression worked great, the second did not.

I guess that what I'm looking for is for a way to place only one leading and only one trailing space when a dash is found no matter how many spaces or lack of spaces there are around that dash character.

Thanks once again!!!

Try \s*-\s* as expression.

It worked!!!

Thanks Dano...


I have another somewhat related question, why won't this expression work: Replace "_FILENAME": "^.mp3" -> ".mp3", where ^ represents a space?

I also tried selecting "only as whole word" and/or "case-sensitive comparrison"... also didn't work.

Thanks in advance for your time and efforts.

I think in "Replace" the _FILENAME does not include the extension.

I wrote here how to do it with regular expressions.

What more can I say than THANKS AGAIN!