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

[Clip] Re: Sorting queries.

Expand Messages
  • Claes Gauffin
    Hi John, ... 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
    Message 1 of 9 , Sep 6, 1999
    • 0 Attachment
      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%
    • Claes Gauffin
      Hi Kay, John, ... Perhaps a little cleaning up at the end? Regards /Claes ; Grandma Kay 09-03-99 ; sort urls by text following last / ; use on copy of
      Message 2 of 9 , Sep 6, 1999
      • 0 Attachment
        Hi Kay, John,

        At 13:35 1999-09-03 -0700, you wrote:

        >
        >----Start Clip----
        >H=Sort urls by File
        >; Grandma Kay 09-03-99
        >; sort urls by text following last /
        >; use on copy of original doc

        Perhaps a little cleaning up at the end?

        Regards /Claes

        ; Grandma Kay 09-03-99
        ; sort urls by text following last /
        ; use on copy of original doc
        ^!SetWordWrap False
        ^!Set %list%=
        ^!Set %num%=1

        :Loop
        ^!Jump ^%num%
        ^!KeyBoard Shift+End
        ^!Set %temp%=^$GetSelection$
        ^!Set %chop%=^$StrPosRight("/";"^%temp%";No)$
        ^!Inc %chop%
        ^!Set %end%=^$StrSize("^%temp%")$
        ^!Set %name%=^$StrCopy("^%temp%";^%chop%;^%end%)$
        ^!KeyBoard Home #^%name% xyzzy#

        ^!Inc %num%
        ^!If ^%num% > ^$GetLineCount$ Sort ELSE Loop

        :Sort
        ^!StatusClose
        ^!ToolBar Select All
        ^!ToolBar Sort Ascending

        ^!Jump DOC_START
        :CleanUp
        ^!Replace ".* xyzzy" >> "" TSR
        ^!IfError Exit
        ^!GoTo CleanUp
      Your message has been successfully submitted and would be delivered to recipients shortly.