Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Replacing different values with one value

    Help wanted · · · – – – · · ·
    replace
    2
    5
    310
    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 Summary
      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 Kilborn 2 Replies Last reply Reply Quote 0
      • Alan Kilborn
        Alan Kilborn @2 mins Summary last edited by

        @2-mins-summary

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

        Alan Kilborn 2 mins Summary 2 Replies Last reply Reply Quote 2
        • Alan Kilborn
          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 Kilborn
            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 Summary
              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
              • First post
                Last post
              Copyright © 2014 NodeBB Forums | Contributors