[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev TRST : use the printer, stupid!
From: |
Philip Webb |
Subject: |
Re: lynx-dev TRST : use the printer, stupid! |
Date: |
Wed, 10 Nov 1999 06:32:00 -0500 (EST) |
991108-9 KW, HN & PW threw suggestions around in an attempt
to have Lynx process documents to delete <P>, </P> & <BR> within tables.
at the end of the last instalment, i had an awk script which did the job.
now read on ...
(1) add a line to lynx.cfg reading (edited for your system/name/tastes):
PRINTER:Process tables:awk -f /homes/purslow/bin/ltab.m1 %s >%s:TRUE
where ltab.m1 is the awk program below;
(2) get the document you want to process, using a link or g ;
(3) use \ to get the source;
(4) enter p & select the appropriate [n] on the print screen;
(5) Lynx will prompt for an output file name: use extension .html
& if you don't want the current directory, give the full path (not ~ );
(6) if you want to review the result on screen,
use g again with the filename you gave.
the ltab.m1 awk program is:
BEGIN { FS = "<" ; u=0 }
$0 == "" {print $0}
$0 != "" {for (i=1; i<=NF; i++) {
t=0;
if ($i ~ /^[Tt][Aa][Bb][Ll][Ee].*>.*/) u=u+1;
if ($i ~ /^\/[Tt][Aa][Bb][Ll][Ee]/) {u=u-1; if (u<0) u=0};
if (u>0 && ($i ~ /^[Pp]/ || $i ~ /^\/[Pp]/ || $i ~ /^[Bb][Rr]/ ))
{o=">"; split($i,a,o); printf "%s", a[2]; t=1};
if (t==0) {
if ($i ~ />/) printf "<";
printf "%s", $i }}; printf "\n" }
--
========================,,============================================
SUPPORT ___________//___, Philip Webb : address@hidden
ELECTRIC /] [] [] [] [] []| Centre for Urban & Community Studies
TRANSIT `-O----------O---' University of Toronto
- Re: lynx-dev TRST & lynxcgi, (continued)
- Re: lynx-dev TRST & lynxcgi, Klaus Weide, 1999/11/08
- Re: lynx-dev TRST & lynxcgi, Philip Webb, 1999/11/08
- Re: lynx-dev TRST & lynxcgi, Klaus Weide, 1999/11/08
- Re: lynx-dev TRST & lynxcgi, Philip Webb, 1999/11/08
- Re: lynx-dev TRST & lynxcgi, Klaus Weide, 1999/11/08
- Re: lynx-dev TRST & lynxcgi, Philip Webb, 1999/11/08
- Re: lynx-dev TRST & lynxcgi, Vlad Harchev, 1999/11/09
- Re: lynx-dev TRST & lynxcgi, Vlad Harchev, 1999/11/09
- Re: lynx-dev TRST : awk script, Philip Webb, 1999/11/09
- Re: lynx-dev TRST : diff versions of awk & sed: USE GNU!, David Combs, 1999/11/09
- Re: lynx-dev TRST : use the printer, stupid!,
Philip Webb <=