Menu

Copy lines that match search criteria?

2007-07-13
2012-11-13
  • Nathan Hartley

    Nathan Hartley - 2007-07-13

    Is there a way to copy lines that match search criteria? I see you can mark lines that match, but I have not found a way to copy these lines.

    Any help would be greatly appreciated,

    Nathan

     
    • pshute

      pshute - 2007-07-16

      Maybe you need to experiment with Plugins/TextFX TextViz/Show lines with clipboard text.  It'll hide all the lines that don't contain whatever's in the clipboard, allowing you to copy those that do.  Only for simple search criteria, I guess.

       
    • Greg Bullock

      Greg Bullock - 2007-07-14

      I write a keystroke macro for this purpose.  With earlier versions, I could use a clean, temporary editor tab as a staging ground:

      <End>
      <Shift-Home>
      <Ctrl-C>
      <Ctrl-Tab>
      <Ctrl-V>
      <Enter>
      <Ctrl-Shift-Tab>
      <F3>

      Then I prepopulate the Find dialog with the search string, close the dialog, and repeatedly play back the macro.  When it's finished, the other editor tab contains the matching lines.

      This no longer works as is, as the macro recorder seems to no longer handle the <Ctrl-Tab> & <Ctrl-Shift-Tab> keystrokes predictably, due to some recent improvements to NP++ in navigation between tabs.  So now I use the end of the file as the staging ground:

      <End>
      <Shift-Home>
      <Ctrl-C>
      <Ctrl-F2>
      <Ctrl-V>
      <Enter>
      <F2>
      <Ctrl-F2>
      <F3>

      When it's finished, I cut the copied lines from the end of the file to the clipboard with essentially the same result.

      Regards.
      Greg