sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
From: Nigel Roles <ngr@symbionics.co.uk>
To: "'Jim.Robinson@Stanford.Edu'" <Jim.Robinson@Stanford.Edu>,
	sam Fans <sam-fans@hawkwind.utcs.toronto.edu>
Subject: RE: formatting HTML tables in ascii
Date: Wed, 1 Sep 1999 04:07:54 -0400	[thread overview]
Message-ID: <1E485299309FD211A2100090271E27A4143246@symnt3.cadence.com> (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?

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                       jim.robinson@stanford.edu
Stanford University HighWire Press      http://highwire.stanford.edu/
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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=1E485299309FD211A2100090271E27A4143246@symnt3.cadence.com \
    --to=ngr@symbionics.co.uk \
    --cc=Jim.Robinson@Stanford.Edu \
    --cc=sam-fans@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).