sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
From: Nigel Roles <>
To: "'Jim.Robinson@Stanford.Edu'" <Jim.Robinson@Stanford.Edu>,
	sam Fans <>
Subject: RE: formatting HTML tables in ascii
Date: Wed, 1 Sep 1999 04:07:54 -0400	[thread overview]
Message-ID: <> (raw)

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:Jim.Robinson@Stanford.Edu]
Sent: Tuesday, August 31, 1999 4:47 PM
To: sam Fans
Subject: formatting HTML tables in ascii

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?

                      LATIN CAPITAL LETTER HWAIR 
                                                                  Stage 6
                      LATIN CAPITAL LETTER WYNN 
                                                                  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             
Stanford University HighWire Press
650-723-7294 (W) 650-725-9335 (F)   

             reply	other threads:[~1999-09-02  8:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-01  8:07 Nigel Roles [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-08-31 15:47 James A. Robinson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \
    --cc=Jim.Robinson@Stanford.Edu \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).