=?x-unknown?q?Re=3A_=3D=3Fiso-8859-1=3FQ=3FRe=3A=5FFormatting=5Fthe=5Fr?==?x-unknown?q?esult=2E=2E=2E=5F=BF=3D3F=3F=3D?=

Subject: =?x-unknown?q?Re=3A_=3D=3Fiso-8859-1=3FQ=3FRe=3A=5FFormatting=5Fthe=5Fr?==?x-unknown?q?esult=2E=2E=2E=5F=BF=3D3F=3F=3D?=
From: Norman Gray <norman@xxxxxxxxxxxxxxx>
Date: Mon, 4 Oct 1999 10:28:02 +0100 (BST)
Reyes,

> Sorry, I wasn't here this weekend.
> And sorry again because I don't understand, the line 
> % sed '/<[a-zA-Z0-9-]\+$/{:a;N;s/\n>/ >/;t z;s/\n/ /;b
> a;:z;s/\(<[a-zA-Z0-9-]\+\)$/\1/;t a;}' input-file 
> Where must I write this?, Is this a command of Jade?

Sorry - I think I should have given more details.

Sed is a `stream editor' which is common on unix boxes, but which has also
been ported to DOS/Windows and other platforms.  I use a script very
like this to zoom through the files generated by Jade, to reformat some
of the elements (which need to be parsed by a further tool).

I use it like

    for f in *.html; do
        sed 'blah....' $f >$f-fixed
    done

(unix-speak again, but it just applies the same script to each of the
.html files in a directory, sending the output to a new file).

As was pointed out, everything you can do in sed you can do in Perl.
Sed's nice because you can quite naturally get quite complicated
programs into a single line of a script (you can do this with Perl as
well, of course, but...).  I use Perl when I want to do something
complicated, or where I don't mind maintaining a separate script, but
use sed where I want to do something reasonably simple as a component
in another script.  There's More Than One Way To Do It...!

I found a sed FAQ at http://www.ptug.org/sed/sedfaq.html

All the best,

Norman


---------------------------------------------------------------------------
Norman Gray                        http://www.astro.gla.ac.uk/users/norman/
Physics and Astronomy, University of Glasgow, UK     norman@xxxxxxxxxxxxxxx


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread