Thanks to a suggestion from John Ferlito (1 Sept), I've put together a short
search-and-destroy pattern-matching perl script to eliminate references 
to m$ in the Postscript output from Netscape-Netbank receipts and 
transaction records.

Trouble is I end up with blank space where the offending paragraphs 
would have been.

So the next task is to match postscript lines of the form

8.4 609.3 moveto

and check the 609 part - the 3rd \d in  ^\d+\.?\d? \s \d+\.?\d? \s moveto -
and if it is <700, add 50.

The /e modifier wants to work on all 4 digits. How to get round this?

This bit shows my intentions, even though it _quite obviously_ won't work:

#################################################
#                                               #
# while (<>) {                                  #
#                                               #
#    while (/(\d+)\.?(\d)?\s(\d+)\.?(\d+)?/g) { #
#         s/$&/($& < 700? ($& + 50): $&) /exg;          #
#       print ;                                                                        
 #
#         }                                     #
# }                                             #
#################################################

Like I said it won't work, as the s/ line doesn't single out the third
\d in   `8.4 609.3 moveto'.

There's got to be a way.

Nick

On Sat, 1 Sep 2001, John Ferlito wrote:

> On Sat, Sep 01, 2001 at 05:09:31PM +1000, Nick Croft wrote:
> > Sluggers, 
> > 
> > ``moveto'' tags to remove the offending references, but haven't got the 
> > time to recalculate the next 50 or so coordinates. So I end up with a 
> > space where the paragraphs were. Fine but it could be better.
> 
> How about writing a perl script that just subtracts X from the relevant
> commands or is it not really scriptable?


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to