• Login
Community
  • Login

Replacing different values with one value

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
replace
5 Posts 2 Posters 1.3k Views
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
    2 mins Summary
    last edited by Mar 4, 2022, 6:57 PM

    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

    A 2 Replies Last reply Mar 4, 2022, 6:59 PM Reply Quote 0
    • A
      Alan Kilborn @2 mins Summary
      last edited by Mar 4, 2022, 6:59 PM

      @2-mins-summary

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

      A 2 2 Replies Last reply Mar 4, 2022, 7:02 PM Reply Quote 3
      • A
        Alan Kilborn @2 mins Summary
        last edited by Mar 4, 2022, 7:01 PM

        @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
        • A
          Alan Kilborn @Alan Kilborn
          last edited by Mar 4, 2022, 7:02 PM

          @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
            2 mins Summary @Alan Kilborn
            last edited by Mar 4, 2022, 7:02 PM

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

            1 Reply Last reply Reply Quote 3
            3 out of 5
            • First post
              3/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors