Faxfilter not extracting fax number
Teresa Ray (tcray@speedchoice.com)
Sat, 15 May 1999 22:05:18 -0700
Thanks again for the input. I tried various ways, but I also found that, on occasion,
Word seems to change the formating, such that I might get:
(FA), then (X), then (N), etc., etc., etc. and Excel seemed to do it even another way.
I did, however, just now figure out one fairly easy way to
get it working. If I save the file as "FAX#939-4202.doc", then the postscript driver puts the
filename in the header, and it's all one string. Then I changed the filter you sent to look for
"FAX#" instead of "FAX-Nr:" This works not only in Word, but Excel, WordPerfect and it seems,
any file I send via the Samba (postscript) printer.
-----Original Message-----
From: Stephen Davies [SMTP:scldad@sdc.com.au]
Sent: Saturday, May 15, 1999 6:50 PM
To: Teresa Ray
Subject: Re: Faxfilter not extracting fax number
Teresa Ray <tcray@speedchoice.com> wrote:
> The pertinent part of the faxfilter program I'm using is:
> ---------------
> TELEFON=`awk '{ IGNORECASE=1 } /FAX-Nr ?: ?[0-9-]*/ \
> { gsub(/-/,""); \
> anfang=match($0,/ ?: ?/); \
> anfang=anfang+match(substr($0,anfang),/[0-9]/)-1; \
> ende=match(substr($0,anfang),/[^0-9]/)-1; \
> printf ("%s",substr($0,anfang,ende)) \
> }' $FAXFILE`
> --------------------------
> I've also tried using a faxfilter sent to me (thank-you!) from Stephen Davis:
> -----------
> TELEFON=`awk '$3 == "(F)A"{getline;if($3 != "(A)A")next
> getline;if($3 != "(X)A")next
> getline;if($3 != "(-)A")next
> getline;if($3 != "(N)A")next
> getline;if($3 != "(r)A")next
> getline;if($3 != "(:)A")next
> getline;gsub(/[ -()A]/,"",$3);print $3;exit
> }' $FAXFILE`
>
> -------------------------
>
>
.
.
> -0.352 0 (F)A
> -0.324 0 (AX)A
> 0.014 0 (-)A
> -0.324 0 (N)A
> 1.014 0 (r)A
> 1.176 0 32 -0.676 0 (: )D
> (939)S
> -0.986 0 (-)A
> (4202)S
> ; : 0 0 2391 3229 rc 0 0 0 sco F0_42
> Ji
> 296 362 M
> 0.338 0 (T)A
> -0.648 0 (e)A
> -0.338 0 (s)A
> 0.324 0 (t)A
> ;
G'day again Teri.
MS Word is a real bastard in the way it plays with text.
What you are getting is similar to what I get but if you look at your
postscript, you will see that you get (AX)A where I get (A)A and (X)A and
further, your number is split into three bits.
You have two basic choices:
1. try again to ensure that the FAX-Nr: and the number have exactly the same
(minimal) formatting so that the postscript is more uniform,
2. change the faxfilter script to match the format you are getting. (This also
assumes that you use a standard template for all faxes - which is what I do. I
have a standard Fax Cover Sheet doc which I use for all faxes and ensures
that the format is constant.)
A sample variation on the filter (to match your postscript above) would be:
TELEFON=`awk '$3 == "(F)A"{getline;if($3 != "(AX)A")next
getline;if($3 != "(-)A")next
getline;if($3 != "(N)A")next
getline;if($3 != "(r)A")next
getline;if($6 != "(:
)D")next
getline;n=$1;gsub(/[ -()S]/,"",n);getline;getline;gsub(/[()S/,"",$0);n=n $0;print $3;exit
}' $FAXFILE`
(I reckon option 1 is the way to go;-))
Cheers,
Stephen
========================================================================
Stephen Davies Consulting scldad@sdc.com.au
Adelaide, South Australia. Voice: 041-980 1417
Computing & Network solutions. Fax: 08-82728863