Hylafax Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

[hylafax-users] Problem fetching string from faxfile



When i try to fetch these two strings from my faxfile i only get one to
work as i want
and that is the one that is first in the dokument. The other get all text
between the the
first startvariable and the last one on the page.

I want to get the text between SendTextTo and EndText into variable
SENDTEXT
and then the text between SendThisTo and :EndSend into variable SENDADDR

The text can be on more then one row.

Any idès.

    SENDTEXT=`${PS2ASCII} ${FAXPAGE}.$i | ${AWK} '{ IGNORECASE=1 }
/SendTextTo: ?: ?[. @a-z0-9-]*/ \
          {  $1=$1 "xxx"; \
             gsub(/ /,""); \
             anfang1=match($1,/ ?: ?/); \
             anfang1=anfang1+match(substr($1,anfang1),/[@a-z0-9 + .]/)-1; \
             ende1=match(substr($1,anfang1),/:EndText/)-1; \
             printf ("%s",substr($1,anfang1,ende1)); \
          }' `

    # retrieve the faxnumber from the printfile
    # the silly three x's are added because some awk strugle with an
immediate CR
    # we use a PS to ascii pipe to strip (most of) the Postscript controls

    SENDADDR=`${PS2ASCII} ${FAXPAGE}.$i | ${AWK} '{ IGNORECASE=1 }
/SendThisTo ?: ?[. @a-z0-9-]*/ \
          {  $0=$0 "xxx"; \
             gsub(/ /,""); \
             anfang=match($0,/ ?: ?/); \
             anfang=anfang+match(substr($0,anfang),/[@a-z0-9 + .]/)-1; \
             ende=match(substr($0,anfang),/:EndSend/)-1; \
             printf ("%s",substr($0,anfang,ende)); \
          }' `



/Jonny Axelsson





____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@hylafax.org.*



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services