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

1329[Clip] Re: Sorting queries.

Expand Messages
  • Claes Gauffin
    Sep 6, 1999
      Hi John,

      At 00:14 1999-09-04 +1000, you wrote:

      >
      >(2) Is it possible to search the list and show ONLY those lines that
      >have eg. "zdnet" in ? If so how ?
      >
      >(3) Is it possible to show all lines EXCEPT those that contain
      >"zdnet" ? If so how ?

      I think the following clip does it.
      The speed of it can kindly be called modest, possibly dignified.
      Unless you have cows to milk or houses to paint during the wait, I wouldn't
      apply it to files with 10000+ lines.

      Regards /Claes

      H="Extended search"
      ^!SetWordWrap OFF
      ^!Jump TEXT_START
      ^!set %string%=^?[Search string]
      ^!set %case%=^?[Case sensitive==Yes^=""|_No^=I]
      ^!set %regexp%=^?[Reg exp==Yes^="R"|_No^=""]
      ^!set %lno%=^?[Add linenumbers?==_Yes|No]
      ^!set %pn%=^?[Collect lines...==_containing the search argument^=p|not
      containing the search argument^=n]
      ^!set %save%=""
      ^!If ^%pn%=n SearchNotArg
      :SearchArg
      ^!Find "^%string%" TS^%case%^%regexp%
      ^!IfError Done
      ^!set %linecont%= ^$GetLine$
      ^!set %n%=^$[^$StrSize(000^$GetRow$)$-3;0]
      ^!Set rownr=^$StrCopy("000^$GetRow$";^%n%;4)$
      ^!If ^%lno% = Yes Skip
      ^!Set rownr=""
      ^!Append %save%=^%rownr%^%linecont%^%NL%
      ^!If ^$GetRow$=^$GetLineCount$ Done
      ^!Jump +1
      ^!GoTo SearchArg
      :SearchNotArg
      ^!Select LINE
      ^!Find "^%string%" HTS^%case%^%regexp%
      ^!IfError NotThere
      ^!If ^$GetRow$=^$GetLineCount$ Done
      ^!Jump +1
      ^!Goto SearchNotArg
      :NotThere
      ^!set %linecont%= ^$GetLine$
      ^!set %n%=^$[^$StrSize(000^$GetRow$)$-3;0]
      ^!Set rownr=^$StrCopy("000^$GetRow$";^%n%;4)$
      ^!If ^%lno% = Yes Skip
      ^!Set rownr=""
      ^!Append %save%=^%rownr%^%linecont%^%NL%
      ^!If ^$GetRow$=^$GetLineCount$ Done
      ^!Jump LINE_START
      ^!Jump +1
      ^!GoTo SearchNotArg
      :Done
      ^!Toolbar New Document
      ^!InsertText ^%save%
    • Show all 9 messages in this topic