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

how to delete html between tables?

Expand Messages
  • russellmz
    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
    Message 1 of 3 , Mar 1, 2005
    • 0 Attachment
      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". It can sort of be done with another program called
      "Text Magician" but I want to be able to do it in NoteTab Light.

      Does anyone know of a clip that does this already?

      Thanks.
    • 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 2 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 3 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.