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

Re: [Clip] H=HTML Table from Tab Delimited File

Expand Messages
  • Alec Burgess
    Jody: Here s a version that doesn t use any looping and will convert CSV to TSV if that happens to be the format some external app created it. It doesn t have
    Message 1 of 4 , Aug 12, 2005
    • 0 Attachment
      Jody:

      Here's a version that doesn't use any looping and will convert CSV to TSV if
      that happens to be the format some external app created it.

      It doesn't have your CSS stuff but is all one straight line clip. If done
      with Regexp's it could have been cleaner/shorter but would certainly die on
      longer files.

      H=CSVorTab-->Table
      ; Alec Burgess 2005-08-12 (Fri)
      ^!jump TEXT_END
      ^!inserttext ^p

      ; convert CSV to TAB separated "just in case"
      ^!replace "","" >> "^t" wsait
      ^!replace ""^p" >> "^p" wsait
      ^!replace "^p"" >> "^p" wsait
      ; now CSV is TabSV except for possible quote on first line

      ^!replace "^t" >> "</td><td>" wsait
      ^!replace "^p" >> "</td></tr>^p<tr><td>" wsait

      ^!jump TEXT_END
      ^!inserttext ^p</table>
      ^!replace "<tr><td>^p</table>" >> "</table>" wsait

      ^!jump TEXT_START
      ;-long line start
      ^!inserttext ^p<table border="1" cellspacing="0" cellpadding="0"
      width="100%" summary="">^p<tr><td>
      ;-long line end

      ; fix possible quote on first line
      ^!replace "<tr><td>"" >> "<tr><td>" wsait

      ^!jump TEXT_START
      ; wrap table as HTML page - comment next three lines if not required
      ;-long line start
      ^!inserttext <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
      Transitional//EN">^P<html>^P<head>^P<meta http-equiv="Content-Type"
      content="text/html; charset=iso-8859-1">^P<meta name="generator"
      content="NoteTab Pro">^P<title>*auto-table*</title>^P</head>^P<body>^P
      ;-long line end
      ^!jump TEXT_END
      ^!inserttext ^P</body>^P</html>


      Regards ... Alec
      --
      ; ( ) { } [ ] \ | 9 0 + = () {} []


      ---- Original Message ----
      From: "Jody" <kjv-av1611@...>
      To: "NoteTab Clips" <ntb-Clips@yahoogroups.com>
      Sent: Friday, August 12, 2005 08:11
      Subject: [gla: [Clip] H=HTML Table from Tab Delimited File

      > Hi All,
      >
      > I was bored and getting of doing a lot of support eMail
      > so I took
      > a break and made a few Clips. :) The following Clips will
      > make a
      > table from a tab delimited file and uses CSS for
      > enhancement.
    • Jody
      Hi Alec, Cliff, Jeff, & Others, (I copied the Basic list, because most importantly, I felt the members on it might want to read my thanks to list members, and
      Message 2 of 4 , Aug 13, 2005
      • 0 Attachment
        Hi Alec, Cliff, Jeff, & Others,

        (I copied the Basic list, because most importantly, I felt the
        members on it might want to read my thanks to list members, and
        perhaps some could use the Clips posted by Alec and myself.
        Please do not discuss the Clips on the Basic list! TIA)

        Just wanted to say I'm glad somebody could use the Clip, finding it
        useful! I'm also just as happy to see Alec's version posted. I've
        always liked/enjoyed the friendly competitive (for a lack of
        better terms) spirit on the Clips list. We all benefit from it in
        many ways like learning other methods of writing Clips, how other
        code can be used, how to be more artistic, making lines and lines
        of code chopped down to a line or two, and all sorts of other
        helpful tips. Thanks to everybody who participates on the lists
        and keeping the Fookes Software lists friendly, useful, cheerful,
        clean, and kind spirited lists to be on.

        >> Here's a version that doesn't use any looping and will convert
        >> CSV to TSV if that happens to be the format some external app
        >> created it.
        >>
        >> H=CSVorTab-->Table
        >> ; Alec Burgess 2005-08-12 (Fri)
        >
        > H=HTML Table from Tab Delimited File
        > ; eMailed on 06-01-2005, ntb-clips@yahoogroups.com, Jody
        > ; notetab.net, clean-funnies.com, sojourner.us, purewords.org
        > ; http://www.fookes.us http://www.sojourner.us/software
        > ; Run this Clip 1st and read ;comments before using.

        >> Thanks, I have needed this a LONG time, it works faster than
        >> mine and doesn't "hang".
        >>
        >> Used it on a 50 KB file this morning. Beautiful.
        >
        >> Wow! How'd you know I needed this? Are you psycho -- I mean
        >> psychic? Wonderful work, Jody. I've already made use of it
        >> twice today for documentation purposes!

        I've got Fookesability!
        Although at times, no sensibility. <g>
        http://clean-funnies.com

        Jody

        http://sojourner.us/software
        fookes.us, notetab.net
        bwbc.us, sojourner.us
      Your message has been successfully submitted and would be delivered to recipients shortly.