• Login
Community
  • Login

Bulk editing in Notepad ++ program?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 2 Posters 5.2k 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.
  • D
    darkenb
    last edited by Jun 3, 2020, 7:35 PM

    I am doing XML edits in the software, but I want to edit certain patterns collectively.

    For example: As in the picture in this alt text link, I want to change the transcripts of 2 or more patterns at once in many open documents.

    P 1 Reply Last reply Jun 3, 2020, 7:52 PM Reply Quote 0
    • P
      PeterJones @darkenb
      last edited by Jun 3, 2020, 7:52 PM

      @darkenb ,

      From the high level, you can apply the same search/replace patterns to multiple files at once, using the Search > Find in Files dialog in regular-expression mode.

      If you want more help than that, please follow the advice below, and give us more to be able to help you. Especially important in your case is providing text (marked as plaintext using the </> button) so we can see example data before and after the change. (We’ll probably just use one-file examples, but the same expression should work in multiple files, if the example data you give us is representative enough.)

      ----

      Do you want regex search/replace help? Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you. All example text should be marked as plain text using the </> toolbar button or manual Markdown syntax. Screenshots can be pasted from the clipbpard to your post using Ctrl+V to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have and the text you want to get from that data; include examples of things that should match and be transformed, and things that don’t match and should be left alone; show edge cases and make sure you examples are as varied as your real data. Show the regex you already tried, and why you thought it should work; tell us what’s wrong with what you do get… Read the official NPP Searching / Regex docs and the forum’s Regular Expression FAQ. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.

      1 Reply Last reply Reply Quote 0
      • D
        darkenb
        last edited by Jun 3, 2020, 8:08 PM

        Is it possible to explain with an example? what I want is exactly in the picture below. Each document has category tags with different inputs, and I want to translate these tags into one entry at a time. Sorry, what you wrote was a bit complicated.

        Screenshot_1.png

        P 1 Reply Last reply Jun 3, 2020, 9:30 PM Reply Quote 0
        • P
          PeterJones @darkenb
          last edited by PeterJones Jun 3, 2020, 9:30 PM Jun 3, 2020, 9:30 PM

          @darkenb ,

          I asked for text, you gave an image. I asked for “before” and “after” data separately; you put the “before” and “after” in the same screenshot – and even on second reading, I didn’t realize that the to in your image was the change from X to Y indicator rather than part of your text.

          The rest of what I wrote is to help you learn and to help you get better help. The help you receive will only be as good as the effort you put into asking for help.

          For your actual problem:

          • FIND = <category>TEXT (\d)</category>
          • REPLACE = <category>TEXT $1$1</category>
          • Search Mode = regular expression

          (untested)

          I recommend you backup any files you try this on, and only try it on one file until everything is working.

          There are obvious assumptions in my example – that your text is literally TEXT every time, and that you’ll always only have one digit after text before </category> – but if my answer is not sufficient for your needs, you are going to have to do a better job of providing data that represents your data, and showing a willingness to learn.

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