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

Re: [Clip] how to delete html between tables?

Expand Messages
  • Don Daugherty
    ... I think the following clip will do the job (or come close anyway): Purge Non-Tables ^!SetDebug On ^!Jump Text_Start ... ^!Set
    Message 1 of 3 , Mar 8, 2005
    • 0 Attachment
      russellmz wrote:

      >I made some macro clips to turn an html file into csv format. But I
      >can't figure out how to get rid of everything in between tables.
      >
      >So, with:
      >
      >HEADING <table>...</table> STUFF <table>...</table> OTHER STUFF
      ><table>...</table> END
      >
      >I want a clip to get rid of "HEADING", "STUFF", "OTHER
      >STUFF", and "END".
      >
      I think the following clip will do the job (or come close anyway):

      Purge Non-Tables
      ^!SetDebug On
      ^!Jump Text_Start
      :Loop
      ^!Set %PurgeStart%=^$GetRow$:^$GetCol$
      ^!Find "<table" TIS
      ^!IfError Finish
      ^!Jump Select_Start
      ^!Set %PurgeEnd%=^$GetRow$:^$GetCol$
      ^!SetCursor ^%PurgeStart%
      ^!SelectTo ^%PurgeEnd%
      ^!InsertText ^%Empty%
      ^!Find "</table>" TIS
      ^!IfError End
      ^!Jump Select_End
      ^!GoTo Loop
      :Finish
      ^!Jump Text_End
      ^!Set %PurgeEnd%=^$GetRow$:^$GetCol$
      ^!SetCursor ^%PurgeStart%
      ^!SelectTo ^%PurgeEnd%
      ^!InsertText ^%Empty%
    • Don - htmlfixit.com
      ... Only works on non-nested tables. You can use it with my tag matching clip in combination to get a better result if necessary. That clip can be found here:
      Message 2 of 3 , Mar 9, 2005
      • 0 Attachment
        > ^!Find "</table>" TIS
        > ^!IfError End

        Only works on non-nested tables. You can use it with my tag matching
        clip in combination to get a better result if necessary.

        That clip can be found here:
        http://htmlfixit.com/blog/index.php?p=308
      Your message has been successfully submitted and would be delivered to recipients shortly.