Community
    • Login

    How to replace only in rows with a special text?

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 2 Posters 536 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.
    • ErwinSchmidt17E Offline
      ErwinSchmidt17
      last edited by

      Hello, I want to replace text but only in rows that have a special text. Example:

      file: image1_5000x5000.png, projectID: 1234
      file: image2_5000x5000.png, projectID: 5678
      file: image3_4000x4000.png, projectID: 1234

      Now I want to replace 5000x5000 with 45000x4500 but ONLY in the rows where I have the text “projectID: 1234”
      So after the replacement I have this:

      file: image1_4500x4500.png, projectID: 1234
      file: image2_5000x5000.png, projectID: 5678
      file: image3_4000x4000.png, projectID: 1234

      How can I do that?

      EkopalypseE 1 Reply Last reply Reply Quote 1
      • EkopalypseE Offline
        Ekopalypse @ErwinSchmidt17
        last edited by

        @ErwinSchmidt17

        given your example data you could do
        find what:5000x5000(?=.*?projectID: 1234)
        replace with:4500x4500
        having Regular expression checked.

        ErwinSchmidt17E 1 Reply Last reply Reply Quote 2
        • ErwinSchmidt17E Offline
          ErwinSchmidt17 @Ekopalypse
          last edited by

          @Ekopalypse said in How to replace only in rows with a special text?:

          5000x5000(?=.*?projectID: 1234)

          Thank you. That worked.

          1 Reply Last reply Reply Quote 2

          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