Community
    • Login

    Replacing different values with one value

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    replace
    5 Posts 2 Posters 2.4k 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.
    • 2 mins Summary2 Offline
      2 mins Summary
      last edited by

      Hi everyone,

      I am a newbie in using this great software, and I am struggling to find a way to replace different values with one value.

      For example, I want to find the values of width then replace them to a specific value (say 100) :

      width=“170” length=“70”
      width=“110” length=“80”
      width=“90” length=“70”

      To:
      width=“100” length=“70”
      width=“100” length=“80”
      width=“100” length=“70”

      I have tried to type width=“.*” in the Find what: zone, and width=“10” in the Replace what: zone.

      This method did work, however it is removing whatever after the value ( the length in this example)

      I really appreciate it if you can help me

      Alan KilbornA 2 Replies Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @2 mins Summary
        last edited by

        @2-mins-summary

        Find: width="\d+"
        Replace: width="100"
        Search mode: Regular expression

        Alan KilbornA 2 mins Summary2 2 Replies Last reply Reply Quote 3
        • Alan KilbornA Offline
          Alan Kilborn @2 mins Summary
          last edited by

          @2-mins-summary

          There is some great material on these types of data manipulations in the user manual as well as on this site, see here.

          1 Reply Last reply Reply Quote 2
          • Alan KilbornA Offline
            Alan Kilborn @Alan Kilborn
            last edited by

            @alan-kilborn said in Replacing different values with one value:

            Find: width=“\d+”
            Replace: width=“100”
            Search mode: Regular expression

            And a presumption here is that you have straight quotes " in your real data, and not curly quotes “” like you show.

            1 Reply Last reply Reply Quote 2
            • 2 mins Summary2 Offline
              2 mins Summary @Alan Kilborn
              last edited by

              @alan-kilborn I really appreciate it
              God bless you
              you made my day

              1 Reply Last reply Reply Quote 3

              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