Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Searching for multiple text items

Expand Messages
  • Sheri
    ... Hmn, I tried it from the command line and after a few lines of short-file-name-style output it gave an error Invalid function call. Its either not fully
    Message 1 of 26 , May 31, 2009
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, "Flo" <flo.gehrke@...> wrote:
      > http://www.dreamlandbbs.com/files/filegate/utilnet/utilnet/
      >
      > and tried bfnd0208.zip, containing BFIND.EXE that works with FIND. I placed this tool in C:\Windows and managed to run it from the command line, for example:
      >
      > bfind apples e:\notetab\documents\*.txt
      >
      > But I didn't solicit any result from this tool when using it with a clip like...
      >
      > ^!Info ^$GetOutput("bfind apples e:\notetab\Documents\*.txt")$
      >
      > What's wrong with this?
      >

      Hmn, I tried it from the command line and after a few lines of short-file-name-style output it gave an error "Invalid function call."

      Its either not fully compatible with XP or with NTFS.

      I haven't tried it from NoteTab, but ^$GetOutput$ only works with 32 bit apps. You can try ^$GetDosOutput$.

      Regards,
      Sheri
    • Flo
      ... Yes, Sheri, you are right: For me, BFIND works with ^$GetDosOutput$. Also you have to use short path and file names in the old DOS-style. Entering the path
      Message 2 of 26 , Jun 1, 2009
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:

        > You can try ^$GetDosOutput$.

        Yes, Sheri, you are right: For me, BFIND works with ^$GetDosOutput$. Also you have to use short path and file names in the old DOS-style. Entering the path with ^$GetDocumentPath$ is not accepted.

        Just copy BFIND.EXE to C:\Windows (no more installation needed).

        Here's is a short clip that works for me. Assuming that the files to be searched are stored in e:\notetab\documents\...


        ^!SetWizardLabel Find with Boolean operators
        ^!Set %Search%=^?{Enter search words separated with space:}; %Spec%=^?{File specification:=*.TXT}
        ^$GetDosOutput(bfind /i /-empty ^%Search% e:\notetab\Docume~1\^%Spec%)$


        Start the clip from an empty document -- the result will be inserted. The file specification is TXT by default but you may limit it to MYFILES*.TXT, for example.

        Enter search words like this...

        apples
        apples and oranges
        (apples or oranges) and not bananas

        For more information about the syntax see BFIND.TXT that comes with BFND0208.ZIP. Here is another download address: http://users.erols.com/waynesof/bruce.htm

        Regards,
        Flo
      • Don - HtmlFixIt.com
        wonder if there is a third person with a clue what you two are talking about ... man you guys impress me sometimes but I have zero idea where we are or what we
        Message 3 of 26 , Jun 1, 2009
        • 0 Attachment
          wonder if there is a third person with a clue what you two are talking
          about ...
          man you guys impress me sometimes but I have zero idea where we are or
          what we are doing as this is WAY over my head ... but then regex used to
          completely be that way too ... now I get it some of the time at least

          thanks to both of you for your continued help

          Flo wrote:
          > --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
          >
          >> You can try ^$GetDosOutput$.
          >
          > Yes, Sheri, you are right: For me, BFIND works with ^$GetDosOutput$. Also you have to use short path and file names in the old DOS-style. Entering the path with ^$GetDocumentPath$ is not accepted.
          >
          > Just copy BFIND.EXE to C:\Windows (no more installation needed).
          >
          > Here's is a short clip that works for me. Assuming that the files to be searched are stored in e:\notetab\documents\...
          >
          >
          > ^!SetWizardLabel Find with Boolean operators
          > ^!Set %Search%=^?{Enter search words separated with space:}; %Spec%=^?{File specification:=*.TXT}
          > ^$GetDosOutput(bfind /i /-empty ^%Search% e:\notetab\Docume~1\^%Spec%)$
          >
          >
          > Start the clip from an empty document -- the result will be inserted. The file specification is TXT by default but you may limit it to MYFILES*.TXT, for example.
          >
          > Enter search words like this...
          >
          > apples
          > apples and oranges
          > (apples or oranges) and not bananas
          >
          > For more information about the syntax see BFIND.TXT that comes with BFND0208.ZIP. Here is another download address: http://users.erols.com/waynesof/bruce.htm
          >
          > Regards,
          > Flo
          >
          >
          >
          >
          >
          >
          > ------------------------------------
          >
          > Fookes Software: http://www.fookes.com/
          > NoteTab website: http://www.notetab.com/
          > NoteTab Discussion Lists: http://www.notetab.com/groups.php
          >
          > ***
          > Yahoo! Groups Links
          >
          >
          >
          >
        • Sheri
          ... With effort I managed to determine which of my txt files bfind didn t like, and once removed, I didn t get the Invalid Function error. My test folder has
          Message 4 of 26 , Jun 1, 2009
          • 0 Attachment
            --- In ntb-clips@yahoogroups.com, "Flo" <flo.gehrke@...> wrote:
            >
            > --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@> wrote:
            >
            > > You can try ^$GetDosOutput$.
            >
            > Yes, Sheri, you are right: For me, BFIND works with
            > ^$GetDosOutput$. Also you have to use short path and file names
            > in the old DOS-style. Entering the path with ^$GetDocumentPath$
            > is not accepted.
            >
            > Just copy BFIND.EXE to C:\Windows (no more installation needed).
            >

            With effort I managed to determine which of my txt files bfind didn't like, and once removed, I didn't get the "Invalid Function" error. My test folder has (or had) 76 txt files of various sizes.

            I see that it is not really testing whole words. Looking for "abc" finds Babcock, for example.

            Also, if searching *.txt or a file with a filelist using the option @filename, it is apparent that it quits if it hits a file that elicits this message:

            (Warning... No EOL within first 24000 characters. Skipping...)

            Sadly, it didn't say which file caused that message, so there was more hunting. :/

            When searching individual files, I found additional matches in files with file names past the file that gave that warning.

            Also, DOS doesn't like non-ascii characters. "Zuschuß" is in the word list you once posted, but using that as a search word in the clip wizard gets no matches.

            The bfind text file states: "As with most DOS-based utilities,
            this program doesn't understand the weird subdirectories, long
            filenames, invalid characters that are possible under Windows."

            So, be aware of such issues when you use it.

            Regards,
            Sheri
          • Alec Burgess
            Don - HtmlFixIt.com (don@htmlfixit.com) wrote (in part) (on 2009-06-01 ... -- Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)
            Message 5 of 26 , Jun 1, 2009
            • 0 Attachment
              Don - HtmlFixIt.com (don@...) wrote (in part) (on 2009-06-01
              at 12:28):
              > wonder if there is a third person with a clue what you two are talking
              > about ...

              :-)

              --
              Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)




              [Non-text portions of this message have been removed]
            • Alec Burgess
              Sheri (silvermoonwoman@comcast.net) wrote (in part) (on 2009-06-01 at ... Flo/Sheri - I haven t followed this in detail and had never heard of bfind before
              Message 6 of 26 , Jun 1, 2009
              • 0 Attachment
                Sheri (silvermoonwoman@...) wrote (in part) (on 2009-06-01 at
                18:11):
                > The bfind text file states: "As with most DOS-based utilities,
                > this program doesn't understand the weird subdirectories, long
                > filenames, invalid characters that are possible under Windows."

                Flo/Sheri - I haven't followed this in detail and had never heard of
                bfind before but are either of you familiar with Unix based text
                processing commands available via UnxUtils (smaller download and less
                extraneous programs) or Cygwin? By putting their programs in your $PATH
                environment that can be used (I think) co-equal with "standard" DOS
                commands.

                I'd be looking at one of the grep variants (egrep, fgrep, grep - I've
                never been quite clear on the distinctions), sed (can handle both
                finding and replacing) and possible awk. All of these can be used in
                conjunction with $GetOutput$ and/or $GetDosOutput$

                Not sure which (if any handle Unicode etc).

                For AND logic I'd be looking at generating a list of files containing
                1st word with a grep command, piping that into a second grep command
                looking for 2nd word , ... , rinse, lather and repeat till Nth word.

                For OR logic - running a grep for each word generating N file-lists,
                concatenating them together eliminating duplicates.

                Assuming you don't want to instead find a purpose-built utility but do
                it all as close to Notetab clips as possible the next level would be to
                get sufficient knowledge of another scripting language that solutions
                would readily come to mind in one of them. (eg. perl, python, ruby,
                vbscript, powerscript, lua). Unfortunately I' haven't taken the time
                (hours, days(?), weeks(?) ... longer(?)) to get that familiarity.

                --
                Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)




                [Non-text portions of this message have been removed]
              • Sheri
                ... Hi Alec (Flo), I think Flo was hoping for an easy, free solution to boolean searches that could be launched from clips. Bfind takes compound boolean
                Message 7 of 26 , Jun 1, 2009
                • 0 Attachment
                  --- In ntb-clips@yahoogroups.com, Alec Burgess <buralex@...> wrote:
                  >
                  >
                  > Sheri (silvermoonwoman@...) wrote (in part) (on 2009-06-01 at
                  > 18:11):
                  > > The bfind text file states: "As with most DOS-based utilities,
                  > > this program doesn't understand the weird subdirectories, long
                  > > filenames, invalid characters that are possible under Windows."
                  >
                  > Flo/Sheri - I haven't followed this in detail and had never heard
                  > of bfind before but are either of you familiar with Unix based
                  > text processing commands available via UnxUtils (smaller download
                  > and less extraneous programs) or Cygwin? By putting their
                  > programs in your $PATH environment that can be used (I think)
                  > co-equal with "standard" DOS commands.

                  Hi Alec (Flo),

                  I think Flo was hoping for an easy, free solution to boolean searches that could be launched from clips. Bfind takes compound boolean expressions. Too bad Mr. Guthrie never updated beyond VBasic Compiler for DOS 1.0. His documentation was written using PE2 (which prompted my recent poorly received nostalgia... :D)

                  But anyway. If you come across a better command line tool that works well on Windows, let us know.

                  > For AND logic I'd be looking at generating a list of files
                  > containing 1st word with a grep command, piping that into a
                  > second grep command looking for 2nd word , ... , rinse, lather
                  > and repeat till Nth word.

                  Exactly what the recently posted clip-to-bat-to-^$GetOutput$ (using Findstr) did. I may refine that a bit.
                  >
                  > For OR logic - running a grep for each word generating N
                  > file-lists, concatenating them together eliminating duplicates.

                  Findstr handles "Or" directly. A list of search words is automatically or'ed. Findstr also does regular expressions, which one would think could alternate or's.

                  Actually Bfind is also good addition to the toolbox once you get a handle on its limitations. Flo, Bfind was a "good find" :D

                  Regards,
                  Sheri
                • Flo
                  ... Yes, Sheri, that s my point. To be launched from a clip and returning the search results to NT. Or more detailed: 1. Start a clip in NT 2. Use hard-coded
                  Message 8 of 26 , Jun 2, 2009
                  • 0 Attachment
                    --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
                    >
                    >
                    > Hi Alec (Flo),
                    >
                    > I think Flo was hoping for an easy, free solution to boolean
                    > searches that could be launched from clips...

                    > I think Flo was hoping for an easy, free solution to boolean
                    > searches that could be launched from clips.

                    Yes, Sheri, that's my point. To be launched from a clip and returning the search results to NT. Or more detailed:

                    1. Start a clip in NT
                    2. Use hard-coded search criteria or enter them in a wizard
                    3. Send these criteria as parameters to an external tool
                    4. Return the search results to NT, i.e. insert the results into a document or continue clip execution with these results.

                    I agree with you that BFIND is not the standard we need though it masters Boolean Expressions. (By the way: We may improve that whole-words issue a little bit by adding spaces and writing "·Babcock·" (quoted) but again this wouldn't cover all variations.)

                    Maybe the best solution would be an utility that combines something like BFIND (Boolean expressions) with FINDSTR (RegEx), or another tool that we havn't seen so far.

                    Those work-arounds with GREP or FINDSTR are able to simulate a Boolean AND, OR, and probably also a NOT. But -- as I said before -- we'll get into trouble when trying to create a solution executing enlarged Boolean queries like Chilli's example "(apples AND oranges) OR (apples AND bananas)".

                    There are tools perfectly executing such Boolean queries -- I mentioned InfoRapid (http://www.inforapid.de/html/searchreplace.htm), for example. Another nice little tool is WanyWord (http://home4.inet.tele.dk/jensguld/). But the problem with these programs is how to fully integrate them in a clip as mentioned above.

                    So I agree with Sheri's summary: "But anyway. If you come across a better command line tool that works well on Windows, let us know."

                    Or we may see an improved Search Disk Command in the future. i.e.: a Search Disk that executes Boolean search and comes with commands for scripting. I wonder why Eric Fookes shows that "fair amount of reserve" with respect to these issues though the drawbacks of Search Disk have often been discussed in this forum...

                    Regards,
                    Flo
                  • Sheri
                    Hi Flo, FWIW, More on Findstr: Its regex features are quite limited, e.g., vertical bar, plus sign and question mark have no special meaning. Findstr search
                    Message 9 of 26 , Jun 4, 2009
                    • 0 Attachment
                      Hi Flo,

                      FWIW, More on Findstr:

                      Its regex features are quite limited, e.g., vertical bar, plus sign and question mark have no special meaning.

                      Findstr search strings can be stored in a file read with /G: parameter (one string per line, where lines are "or'ed"). If read from a file, ansi characters with high decimal values lik "ß" work fine. But if such characters are included on the command line, e.g., in ^$GetOutPut$, they won't work.

                      Regards,
                      Sheri






                      terms submitted on the command line contain such characters, they don't work.

                      --- In ntb-clips@yahoogroups.com, "Flo" <flo.gehrke@...> wrote:
                      >
                      > --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@> wrote:
                      > >
                      > >
                      > > Hi Alec (Flo),
                      > >
                      > > I think Flo was hoping for an easy, free solution to boolean
                      > > searches that could be launched from clips...
                      >
                      > > I think Flo was hoping for an easy, free solution to boolean
                      > > searches that could be launched from clips.
                      >
                      > Yes, Sheri, that's my point. To be launched from a clip and returning the search results to NT. Or more detailed:
                      >
                      > 1. Start a clip in NT
                      > 2. Use hard-coded search criteria or enter them in a wizard
                      > 3. Send these criteria as parameters to an external tool
                      > 4. Return the search results to NT, i.e. insert the results into a document or continue clip execution with these results.
                      >
                      > I agree with you that BFIND is not the standard we need though it masters Boolean Expressions. (By the way: We may improve that whole-words issue a little bit by adding spaces and writing "·Babcock·" (quoted) but again this wouldn't cover all variations.)
                      >
                      > Maybe the best solution would be an utility that combines something like BFIND (Boolean expressions) with FINDSTR (RegEx), or another tool that we havn't seen so far.
                      >
                      > Those work-arounds with GREP or FINDSTR are able to simulate a Boolean AND, OR, and probably also a NOT. But -- as I said before -- we'll get into trouble when trying to create a solution executing enlarged Boolean queries like Chilli's example "(apples AND oranges) OR (apples AND bananas)".
                      >
                      > There are tools perfectly executing such Boolean queries -- I mentioned InfoRapid (http://www.inforapid.de/html/searchreplace.htm), for example. Another nice little tool is WanyWord (http://home4.inet.tele.dk/jensguld/). But the problem with these programs is how to fully integrate them in a clip as mentioned above.
                      >
                      > So I agree with Sheri's summary: "But anyway. If you come across a better command line tool that works well on Windows, let us know."
                      >
                      > Or we may see an improved Search Disk Command in the future. i.e.: a Search Disk that executes Boolean search and comes with commands for scripting. I wonder why Eric Fookes shows that "fair amount of reserve" with respect to these issues though the drawbacks of Search Disk have often been discussed in this forum...
                      >
                      > Regards,
                      > Flo
                      >
                    • Flo
                      ... Thanks for these hints, Sheri! I ve tested some ß . When stored in a file, it works fine. Flo
                      Message 10 of 26 , Jun 4, 2009
                      • 0 Attachment
                        --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
                        >
                        > Hi Flo,
                        >
                        > FWIW, More on Findstr:
                        >
                        > Its regex features are quite limited, e.g., vertical bar, plus sign and question mark have no special meaning.
                        >
                        > Findstr search strings can be stored in a file read with /G: parameter (one string per line, where lines are "or'ed"). If read from a file, ansi characters with high decimal values lik "ß" work fine. But if such characters are included on the command line, e.g., in ^$GetOutPut$, they won't work.
                        >
                        > Regards,
                        > Sheri

                        Thanks for these hints, Sheri! I've tested some "ß". When stored in a file, it works fine.

                        Flo
                      • chilli_palmer@sbcglobal.net
                        ... version 3 was released, so it hasn t really been raised by half overnight. ... The FREE PRGrep worked perfectly well. Once it identified the text files
                        Message 11 of 26 , Jun 7, 2009
                        • 0 Attachment
                          --- In ntb-clips@yahoogroups.com, Jane Sedgewick <jane_sedgewick@...>
                          wrote:
                          >
                          > Actually, Powergrep has been $149 since at least 2005 around the time
                          version 3 was released, so it hasn't really been raised by half
                          overnight.
                          >
                          >
                          >
                          > Jane

                          The FREE PRGrep worked perfectly well. Once it identified the text
                          files with the information, opening and finishing up with Notetab was
                          just great.

                          The best thing out of this whole experience is being referred to these
                          groups by Fookes support email, and you guys letting me know to upgrade
                          from 4.95 to 6.1 which I love.

                          Thanks again!



                          [Non-text portions of this message have been removed]
                        Your message has been successfully submitted and would be delivered to recipients shortly.