Community
    • Login

    Macro Selecting Search Results Text and pasting into new file

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 3 Posters 2.1k 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.
    • Phil GriggP
      Phil Grigg
      last edited by

      I am trying to write a marco to search specific text strings and then copy the results into a new notepad++ file. I cannot get the marco to copy the search window results.

      1 Reply Last reply Reply Quote 1
      • Terry RT
        Terry R
        last edited by

        @Phil-Grigg I’m not sure if you want to create a macro as you think that’s the only way to fix your issue or that you DO want a macro. But in terms of what you seem to want may I suggest reading another recent post.
        https://notepad-plus-plus.org/community/topic/17209/find-text-copy-and-paste-to-another-file
        Where the solution may meet your needs of getting specified text from a file into another tab in Notepad++.
        Terry

        1 Reply Last reply Reply Quote 2
        • Phil GriggP
          Phil Grigg
          last edited by

          preferably, I need a macro to do this. I have hundreds of files I am searching and want to search the find in file results.

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn @Phil Grigg
            last edited by

            @Phil-Grigg

            Macros really only operate for editing commands (i.e., things you can do in the area where you can free-form edit text). So it is not surprising to me that you can’t do things involving the Find result panel and macro recording.

            Phil GriggP 1 Reply Last reply Reply Quote 5
            • Phil GriggP
              Phil Grigg @Alan Kilborn
              last edited by Phil Grigg

              @Alan-Kilborn it should’nt be. Search in files for atext string “Error”:
              <Action type=“3” message=“1700” wParam=“0” lParam=“0” sParam=“” />
              <Action type=“3” message=“1601” wParam=“0” lParam=“0” sParam=“Error” />
              <Action type=“3” message=“1625” wParam=“0” lParam=“0” sParam=“” />
              <Action type=“3” message=“1653” wParam=“0” lParam=“0” sParam=“X:\Logs” />
              <Action type=“3” message=“1652” wParam=“0” lParam=“0” sParam=“*.log” />
              <Action type=“3” message=“1702” wParam=“0” lParam=“32” sParam=“” />
              <Action type=“3” message=“1701” wParam=“0” lParam=“1656” sParam=“” />

              Alan KilbornA 1 Reply Last reply Reply Quote 0
              • Terry RT
                Terry R
                last edited by

                @Phil-Grigg
                Thinking about what you are trying to do, I think a possible solution will be along the lines of the recent post I referred to.
                So firstly you would make a copy of all the log files (your macro code seems to work on *.log files) into another folder/location.
                Depending on where in the line the “Error” text lies your macro code would use a regex (as per the recent post) to put the text you want to remain on separate lines (if an entire line is the error text then you may be able to skip this step). Then another regex would remove ALL lines not starting with “Error”. This macro could operate using the “find in files” as per your wish.
                The result will be files only containing the text which you did NOT delete.

                Terry

                1 Reply Last reply Reply Quote 2
                • Alan KilbornA
                  Alan Kilborn @Phil Grigg
                  last edited by

                  @Phil-Grigg

                  Not sure what your most recent posting is trying to say…

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