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

Re: [Clip] Please help

Expand Messages
  • Piotr Bienkowski
    ... Hi Martha, The following clip should do the job. Copy the table to a new document, close all other documents and leave just the document with the table.
    Message 1 of 4 , Oct 29, 2000
    • 0 Attachment
      Martha Hambrick Harrell wrote:
      >
      > This is a sample of a very large table that I am working on. I would
      > like to extract the names from the first TD ALIGN field to make an
      > alphabetical index of all the surnames. Could someone please tell me
      > how to do it? Thank you.
      >
      > <TR ALIGN="left" BGCOLOR="#FFEFD5">
      > <TD ALIGN="left" BGCOLOR="#FFEFD5">NAME</TD>

      Hi Martha,

      The following clip should do the job. Copy the table to a new document,
      close all other documents and leave just the document with the table.
      When the clip starts it opens a new blank document sets it as pasteboard
      returns to the table, and copies the relevant parts to the clipboard by
      which the names get copied to the other document. Finally, the clip
      sorts your names. You may get a blank line at the beginning. The clip
      works on the assumption that the <TD... part is always indented by one
      character. It will skip all <TD>s that do not conform to this rule.

      Here's the clip

      ; -------------
      ; BEGIN CLIP
      ^!FocusDoc
      ^!Keyboard CTRL+N CTRL+SHIFT+P
      ^!Document PREV
      ^!SetCursor 1:1

      :Loop
      ^!Find "<TR.+\n.<TD.+" RIS
      ^!IfError UnHTML
      ^!Set %namecell%=^$StrStripHTML(^$GetSelection$;False)$
      ^!SetClipBoard ^%namecell%
      ^!Jump SELECT_END
      ^!Goto Loop

      :UnHTML
      ^!Document NEXT
      ^!Keyboard CTRL+SHIFT+P
      ^!SetCursor 1:1
      ^!Replace "^p^p" >> "^p" IS
      ^!Keyboard CTRL+A CTRL+C
      ^!InsertText ^$StrSort("^$GetClipboard$";True;True;True)$
      ; -----------------------------------------------------


      HTH

      Piotr
    Your message has been successfully submitted and would be delivered to recipients shortly.