• Login
Community
  • Login

Copy marked text sections

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
6 Posts 5 Posters 8.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.
  • D
    Dumpling Dumpling
    last edited by Mar 26, 2018, 4:44 PM

    I need to copy text sections

    How can I do that?

    Example:
    [https://postimg.org/image/yxg1sjwlh/](need to copy all red marks)

    S 1 Reply Last reply Mar 26, 2018, 5:03 PM Reply Quote 1
    • S
      Scott Sumner @Dumpling Dumpling
      last edited by Mar 26, 2018, 5:03 PM

      @Dumpling-Dumpling

      The best method I’ve found is by using a Pythonscript. See this thread: https://notepad-plus-plus.org/community/topic/12710/marked-text-manipulation

      1 Reply Last reply Reply Quote 1
      • D
        Dumpling Dumpling
        last edited by Dumpling Dumpling Mar 26, 2018, 5:50 PM Mar 26, 2018, 5:50 PM

        Thanks, it works!

        1 Reply Last reply Reply Quote 1
        • G
          guy038
          last edited by Mar 27, 2018, 11:28 PM

          Hello @dumpling-dumpling and All,

          An alternative to the Scott’s Python script could be a regex S/R, built that way :

          SEARCH : (?s).*?(Your Regex)|.*

          REPLACE \1\r\n

          In your case, the correct regex S/R would be :

          SEARCH (?s).*?('.')|.*

          REPLACE \1\r\n

          • First, copy your file in a new tab

          • Open the Replace dialog ( Ctrl + H )

          • Enter the Search and Replace regexex

          • Tick the Wrap around option

          • Click on the Replace All button

          Et voilà !


          So, with the given text, below :

          <name = 'A' level = '1'>
          <name = 'b' level = '2'>
          <name = 'C' level = '3'>
          <name = 'D' level = '4'>
          <name = 'E' level = '5'>
          

          You would obtain :

          'A'
          '1'
          'b'
          '2'
          'C'
          '3'
          'D'
          '4'
          'E'
          '5'
          

          Cheers,

          guy038

          N 1 Reply Last reply May 19, 2022, 2:39 PM Reply Quote 3
          • N
            Nick Tsangaris @guy038
            last edited by May 19, 2022, 2:39 PM

            @guy038
            Can confirm this works without modification in May 2022. Thanks @guy038 for the easy copy and paste!

            1 Reply Last reply Reply Quote 0
            • A
              Alan Kilborn
              last edited by May 19, 2022, 2:44 PM

              @nick-tsangaris said in Copy marked text sections:

              Can confirm this works without modification in May 2022. Thanks @guy038 for the easy copy and paste!

              Well, now there’s a better way to copy marked text:

              81c96675-f3c0-4f7f-a3e1-6b6f59d98ebf-image.png 2663f6a9-c4cf-4414-a4de-400d84e006d9-image.png

              The Copy Marked Text command button didn’t exist when this thread was created.

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