Remove texts/characters/special chars from list
-
Hi all,
I wanted to know how do I make list 1 equal to list 2.
List 1:
Alex Rider - Stormbreaker? (USA).zip
Allied Ace Pilots? (Europe) (En,Fr,De,Es,It).zip
Alpha and Omega, The (Europe) (En,Fr,De,Es,It).zip
Alvin and the Chipmunks: Chipwrecked (USA) (En,Fr).zip
Alvin and the Chipmunks: The Squeakquel [USA].zipList 2:
Alex Rider - Stormbreaker.zip
Allied Ace Pilots.zip
Alpha and Omega The.zip
Alvin and the Chipmunks Chipwrecked.zip
Alvin and the Chipmunks The Squeakquel.zipHow to remove all “?” “,” “:” “[.]” and all “(.)” ?
Thanks for any help.
Claudio
-
@Claudio-Raphael
It would appear some of the characters you wish to remove may also come with a space behind them (and also in front). So my regular expression (regex) includes this as an option (* means 0 or more).So in the replace function (default Ctrl and H keys) have the search mode as “regular expression” and wrap around ticked.
Find What:\? *| *\(.+?\) *|,| *\[.+?\] *|:
Replace With:empty field
<— nothing here
You can directly copy the red text above and paste into the Find field.A brief run down of the regex. The
|
character acts as alternatives. That way 1 regex can search for multiple strings. As most of the characters you want to look for are special (meta-characters meaning they have special meaning) we use the\
to delimit them. That means it reduces them back to the simple character.Give it a go, come back if you have issues. As can often happen, the example you provide may ot be a FULL representation of the real data.
Terry
-
@Terry-R said:
? *| *(.+?) *|,| *[.+?] *|:
Thank you very much Terry-R. Worked perfectly.
I’ve tested 10 lists and everything is as I wanted it to be.
Thank you again.
Claudio