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

16629Re: Creation of clip

Expand Messages
  • Flo
    Jun 15, 2007
    • 0 Attachment
      I understand that idisnick is working with a keyword list. So I would
      propose to extend Sheri's concept as follows...


      ^!Set %Doc%=^$GetDocIndex$
      ^!Set %Keywords%=^?{(T=O;F="Textfiles (*.txt)|*.txt")Choose Keyword
      File:}
      ^!Open ^%Keywords%
      ; Remove empty lines in keyword list
      ^!Replace "(\r\n){2,}" >> "\r\n" AWRS
      ; Put keywords into alternation
      ^!Replace "\r\n" >> "|" AWRS
      ; Remove "empty alternation" at list end
      ^!Replace "\|\Z" >> "" AWRS
      ^!Select All
      ^!Set %Search%=^$GetSelection$
      ^!Close ^%Keywords% Discard
      ^!SetDocIndex ^%Doc%
      ^!SetListDelimiter ^P
      ^!Set %linesout%=^$GetDocMatchAll("(?-i)^.*(^%Search%).*^%dollar%";0)$
      ^!Toolbar New Document
      ^!InsertText ^%linesout%

      Example: The active document is...

      Froggy Frog
      Lives in a well
      If you want him
      Pull the bell.

      The keyword list is...

      bell
      Frog
      well

      The clip outputs line #1, 2, and 4. May be it needs some improvements
      to work with bigger texts and word lists ;-)

      Flo
       
    • Show all 30 messages in this topic