![]() |
This problem was just me that wasn't thinking. When took a closer look at the variable it had dobble phonenumbers becouse the fax had to pages and the number was one on each page, so when i tried to match it it was not the same. But mabe somone can tell me how to make the awk to only match the first instance it matches and skip the rest or haw to remove the rest from the string. This is the matching procedure i use. SENDADDR=`${PS2ASCII} ${FAXFILE} | ${AWK} '{ IGNORECASE=1 } /SendThisTo ?: ?[. @a-z0-9-]*/ \ { $0=$0 "xxx"; \ gsub(/-/,""); \ gsub(/+46/,"0"); \ gsub(/0046/,"0"); \ anfang=match($0,/ ?: ?/); \ anfang=anfang+match(substr($0,anfang),/[@a-z0-9 + .]/)-1; \ ende=match(substr($0,anfang),/:SLUT/)-1; \ printf ("%s",substr($0,anfang,ende)) \ }' ` The reason that i match letters is that it should be able to get email adresses to. Thanks again. \Jonny Axelsson jonny.axelsson@systea m.se To: hylafax-users@hylafax.org Sent by: cc: hylafax-users-bounce@ Subject: Re: [hylafax-users] Need to remove text in PS file before sending to hylafax. hylafax.org 2002-08-09 13:50 Thanks it works almost perfect but when i run the command in my script it doesn't work as i would like it to. I use this lines ${SED} -e s/SendThisTo:// ${FAXFILE} > ${TEMPFILE1} ${SED} -e s/:SLUT// ${TEMPFILE1} > ${TEMPFILE2} ${SED} -e s/${SENDADDR}// ${TEMPFILE2} > ${FAXFILE2} But the last line where i use an variable as criteria for the search won't work. Anyone knows why. \Jonny Axelsson "Tren Blackburn" <tren@eotnetworks.com To: <hylafax-users@hylafax.org> > cc: Sent by: Subject: Re: [hylafax-users] Need to remove text in PS file before sending to hylafax. hylafax-users-bounce@ hylafax.org 2002-08-09 10:21 Hey; Look into sed =) Regards, Tren > -----Original Message----- > From: hylafax-users-bounce@hylafax.org > [mailto:hylafax-users-bounce@hylafax.org] On Behalf Of > jonny.axelsson@systeam.se > Sent: Friday, August 09, 2002 1:54 AM > To: hylafax-users@hylafax.org > Subject: [hylafax-users] Need to remove text in PS file > before sending to hylafax. > > > Hi > > I hope anyone can help me with this small problem. > I use the script sambafax to send fax to hylafax but before i > fax the file i want to remove the faxnumber from the file. > Now i use this function to do it. > > cat ${FAXFILE} | grep -v "SendFaxTo" > ${FAXFILE2} > > The problem with this is that it destroyes the ps structure. > i have tried to manually remove the text in the file and > leave the rest of the important information on that row and > then it works. > > Is there any good way of replace only this string with a blank? > > /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.* > > ____________________ 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.* ____________________ 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.* ____________________ 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.*