Community
    • Login

    Find option

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 497 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.
    • Mathenay LankouM Offline
      Mathenay Lankou
      last edited by Mathenay Lankou

      I have to compare a lot of strings and keep only distincts strings.
      No problem if there are many identical strings but sometimes I encounter a string that is nearly the same.
      My question : I propose to have a compare string option that gives for each string the percent of identical parts;

      Example:

      France
      Table
      Street
      England
      StreetView

      and we search for “Street”, so the result would be

      France 0%
      Table 0%
      Street 100%
      England 0%
      StreetView 50%

      I have to use this for finding similar streets. After I have to change the similar streets with the unique string. It is for having an index in a database.

      1 Reply Last reply Reply Quote 0
      • guy038G Offline
        guy038
        last edited by

        Hello, @mathenay-lankou and All,

        Here is a regex solution :

        • Open your list of strings. For instance :
        France
        Table
        Street
        England
        StreetView
        
        • Open the Replace dialog ( Ctrl + H )

          • SEARCH (?-is)^(Street)$|(.*(?1).*)|(.+)

          • REPLACE $0(?1 100%)(?2 50%)(?3 0%)

          • Tick the Wrap around, preferably

          • Select the Regular expression search mode

          • Click on the Replace All button

        => You should get the expected list, below :

        France 0%
        Table 0%
        Street 100%
        England 0%
        StreetView 50%
        

        If I’m on the right way, I’ll explain you the regex details, next time ;-))

        Best Regards,

        guy038

        1 Reply Last reply Reply Quote 1

        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