Community
    • Login

    Need help with find and replace using wildcards and in multiple files

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 63 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.
    • P Offline
      Paul Klaes
      last edited by

      Fellow Notepad++ Users,

      Could you please help me the following search-and-replace problem I am having?

      I am trying to replace data under the following format in multiple files, and in multiple occurrences in single files;

      split = 30 40 30
      The “split” in each instance is not always the same.

      I want to replace every occurrence with the following

      split = 33 34 33.

      Please help, thank you.

      dr ramaanandD 1 Reply Last reply Reply Quote 0
      • dr ramaanandD Online
        dr ramaanand @Paul Klaes
        last edited by dr ramaanand

        @Paul-Klaes Are there only 3 digits to be replaced every time? Does the line beginning with the term, “split” end with numbers? Please give a before and after (expected solution) example. If there are only 3 digits, you can hit ctrl+h on your keyboard, click on the, “Find in Files” tab, put (split =) \d+ \d+ \d+ in the Find field and $1 33 34 33 in the Replace field, tick (check) the Regular expression mode and hit the Replace all button. You have to ensure that you select which folder you want to do this in correctly!
        Explanation: $1 represents the capturing group 1 which is what is in parentheses that is used in the “Find field”, in this case, “split =”

        P 1 Reply Last reply Reply Quote 0
        • P Offline
          Paul Klaes @dr ramaanand
          last edited by

          Yes, it is always 3 numbers, it represents a population split among the 3 defined classes for each province in a computer game; and I’m trying for a uniformity among provinces in the mod I’ve created.

          dr ramaanandD 1 Reply Last reply Reply Quote 0
          • dr ramaanandD Online
            dr ramaanand @Paul Klaes
            last edited by

            @Paul-Klaes So, does the solution I provided solve your problem?

            1 Reply Last reply Reply Quote 0

            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