Community
    • Login

    Remove texts/characters/special chars from list

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 1.2k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Claudio RaphaelC Offline
      Claudio Raphael
      last edited by

      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].zip

      List 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.zip

      How to remove all “?” “,” “:” “[.]” and all “(.)” ?

      Thanks for any help.

      Claudio

      1 Reply Last reply Reply Quote 1
      • Terry RT Offline
        Terry R
        last edited by Terry R

        @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

        1 Reply Last reply Reply Quote 3
        • Claudio RaphaelC Offline
          Claudio Raphael
          last edited by

          @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

          1 Reply Last reply Reply Quote 2

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors