Subject: formatting HTML tables in ascii

From: "James A. Robinson" <[email-masked]>
Date: Tue, 31 Aug 1999 11:47:28 -0400

I'm trying to format an HTML table using sam's regexp commands. What
I wanted was a single line for each row, with each column seperated by
a tab.  I can handle single-line columns in a row like

a a a
      b b b b b
                c c c c c
d d d d d
          e e e e e e e e
                          f f

without a problem using

    , y/\n[A-Za-z0-9]/ x/\n/ d
    , x/  +/ c/	/

But how do I craft a regexp to handle a blob of a multicolumn lines?

01F6 
                  1
                      LATIN CAPITAL LETTER HWAIR 
                                                    97-May-29
                                                    Accepted 
                                                                 98-Oct-22
                                                                  Stage 6
01F7 
                  1
                      LATIN CAPITAL LETTER WYNN 
                                                    97-May-29
                                                    Accepted 
                                                                 98-Oct-22
                                                                  Stage 6

I can match the blobs with

    , x/^[A-Za-z0-9]+ *\n( +([A-Za-z0-9\- ]+)+\n)+/

But is there any way to craft a regxp that, in the above example, replaces
'HWAIR\n' with 'HWAIR\t' but replaces '97-May-29\n' with '97-May-29 '
(a column sep vs a line join)?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
James A. Robinson                       [email-masked]
Stanford University HighWire Press      http://highwire.stanford.edu/
650-723-7294 (W) 650-725-9335 (F)

---

From: Nigel Roles <[email-masked]>
Date: Wed, 1 Sep 1999 04:07:54 -0400

My HTML might be a bit weak, but this will swap all the \n's in the
blob to \t's.

,x/^[A-Za-z0-9]+ *(\n +([A-Za-z0-9\- ]+)+)+/x/\n/c/	/

-----Original Message-----
From: James A. Robinson [mailto:[email-masked]]
Sent: Tuesday, August 31, 1999 4:47 PM
To: sam Fans
Subject: formatting HTML tables in ascii

a a a
      b b b b b
                c c c c c
d d d d d
          e e e e e e e e
                          f f

without a problem using

01F6 
                  1