• Login
Community
  • Login

Suggestion: Find in Files from command line

Scheduled Pinned Locked Moved General Discussion
35 Posts 12 Posters 9.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.
  • A
    Alan Kilborn @artie-finkelstein
    last edited by Oct 4, 2021, 7:02 PM

    @artie-finkelstein said in Suggestion: Find in Files from command line:

    grepWin…it uses Boost

    That it uses Boost’s regex engine is a bit obscure – it doesn’t seem to advertise that – is a definite plus for N++ users that are used to it for searching.

    A 1 Reply Last reply Oct 7, 2021, 12:23 AM Reply Quote 0
    • A
      artie-finkelstein @Alan Kilborn
      last edited by Oct 7, 2021, 12:23 AM

      @Alan-Kilborn
      I don’t think the author considers it a major selling point; to many people RE is RE, right up until they get bitten by the flavor differences.

      The author states on the mini help page on his website:
      grepWin uses the boost regex engine to do its work, with the Perl Regular Expression Syntax.

      The F1 help screen in grepWin has links to the top-level (non version specific) Boost documentation (which as of today has ‘release’ resolving to ‘1_77_0’):

      https://www.boost.org/doc/libs/release/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html
      https://www.boost.org/doc/libs/release/libs/regex/doc/html/boost_regex/syntax/character_classes.html
      

      The project source code on github for the current version (2.08) shows it using Boost 1.76.0.0.

      I have not tried any form of “proof of Boostness” as I typically use grepWin for searches similar to: “Which files in this project reference a particular manifest constant?” or “Have I defined this word in another text file in this folder tree?”

      It does offer a replace function, which works well with plain text replacements. I have only tried regex replacements a couple of times (it worked fine). By default, grepWin saves a copy of the original file with a .bak extension added for both replacement styles.

      A 1 Reply Last reply Oct 7, 2021, 11:38 AM Reply Quote 3
      • A
        Alan Kilborn @artie-finkelstein
        last edited by Oct 7, 2021, 11:38 AM

        @artie-finkelstein said in Suggestion: Find in Files from command line:

        to many people RE is RE, right up until they get bitten by the flavor differences.

        You said that very well. :-)

        grepWin uses the boost regex engine to do its work, with the Perl Regular Expression Syntax

        I’m not really sure what that means (the last part).
        I’ve also seen other related references calling it PCRE (Perl Compatible Regular Expression) syntax.
        To me, it’s “Boost RE syntax”.

        A 1 Reply Last reply Oct 8, 2021, 3:13 AM Reply Quote 0
        • A
          artie-finkelstein @Alan Kilborn
          last edited by Oct 8, 2021, 3:13 AM

          @Alan-Kilborn
          Nolo contendere.

          I think my opening statement (BTW: I thought you’d like it) also covers the authors conflation of different RE namings.

          1 Reply Last reply Reply Quote 0
          • N
            Nick Knight
            last edited by Jan 11, 2022, 3:29 PM

            Coming in late, but I was searching for a way to do something similar “from the command line”.

            I have a utility that greps through DB-based data. It lists hits, and if a user chooses one, write the corresponding content to a temp file and opens it up in Notepad++. However, to FIND data from that point, the use has to open the find dialog and type in the text again and press go.

            I’d love to find a way to pre-search, JUST the file opened from the command line, for a specific text string. Have the matching strings already found, highlighted and the cursor on the first match.

            1 Reply Last reply Reply Quote 0
            • C
              Catrin Brooks
              last edited by Jan 24, 2022, 9:05 PM

              Filelocator Lite, which is now known as AgentRansack, is what I’m using. Npp is great, however there is a flaw that can force me to delete it.

              1 Reply Last reply Reply Quote -1
              • W
                WinterSilence
                last edited by Jan 29, 2022, 10:09 PM

                you can do it without notepad https://stackoverflow.com/a/20999154/12517370

                1 Reply Last reply Reply Quote 1
                • V
                  Victorel Petrovich
                  last edited by Apr 12, 2023, 8:06 PM

                  I’d like to use such a feature so that I can integrate with a browser extension that can ask Notepad++ to open the given html file (at rightclick or icon in toolbar) and edit it.
                  Having the feature discussed here would allow me to first select a piece of text, then have Notepad open the html exactly where that is.

                  P 1 Reply Last reply Apr 12, 2023, 8:17 PM Reply Quote 0
                  • P
                    PeterJones @Victorel Petrovich
                    last edited by PeterJones Apr 12, 2023, 8:22 PM Apr 12, 2023, 8:17 PM

                    @Victorel-Petrovich ,

                    If your browser extension knows the line number of the selected text, then you could use the -n command line option to tell Notepad++ which line to scroll to. You don’t need to be able to “find in files” from the command line to implement that behavior.

                    —
                    update: @artie-finkelstein actually pointed out -n in September 2021, though you may not have waded through enough of the posts to notice it, nor maybe understood the implication that it could solve your problem easier than “find-in-files-from-command-line”.

                    V 1 Reply Last reply Jul 25, 2023, 4:37 AM Reply Quote 1
                    • M
                      Mark Olson
                      last edited by Apr 13, 2023, 3:43 AM

                      I like dnGrep, but tbh I use my own gorpy more often than I probably should

                      1 Reply Last reply Reply Quote 0
                      • V
                        Victorel Petrovich @PeterJones
                        last edited by Jul 25, 2023, 4:37 AM

                        @PeterJones
                        Ah, no, that browser extension “External Application Launcher” (https://chrome.google.com/webstore/detail/external-application-laun/bifmfjgpgndemajpeeoiopbeilbaifdo?hl=en-US ) can’t know the line number. I can’t know it myself either.

                        The workflow would be I select a piece of text in the html page in browser, then trigger than extension to command N++ to search the selected text and open at the right place , for me to edit it.

                        1 Reply Last reply Reply Quote 0
                        • M
                          mkupper @Vitaliy Dovgan
                          last edited by Jul 25, 2023, 3:25 PM

                          @Vitaliy-Dovgan said in Suggestion: Find in Files from command line:

                          Notepad++ already has a very powerful Find in Files functionality (Ctrl+Shift+F).
                          … (snipped) …
                          If it looks like a good suggestion, let’s discuss the design here. E.g. what exact names to use for the command arguments, what exact behavior to expect from Notepad++, what other options we may want to set, etc.

                          Based on the number of people chiming in with “I use ... from the command line” it appears they don’t see the finder built into Notepad as the best available.

                          I myself have been using plain old findstr that is built into Windows but often use it in batch file wrappers that end up feeding the results into Notepad++ much like what the proposed -ff style command line options would do.

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