Hi.
I have a price with number of lines wich looks like this:
BenQ-Siemens CF61 12 165.00 5.0900
I am trying to figure out how can I math with price (165.00 in example).
I have created Perl pattern wich extract price and in VB subfilter make a math.
Everything works except I loose all other part of line.
I have tried to save first and last part of line to global variable in VB script before doing a math and then form a result line, but no success. When debugging with message box it looks like last VB subfilter don't see my variables from other subfilters.
Can somebody help me with this?
Math, Global Variable and etc.
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Its sounds like you pattern is matching the entire line, not just the price part of it. If the pattern matches just the price, then only the price will be passed to the scripting subfilter, and you won't lose the remainder of the line.
To share variables between scripting filters, use TextPipe.setGlobalVar and TextPipe.getGlobalVar()
To share variables between scripting filters, use TextPipe.setGlobalVar and TextPipe.getGlobalVar()
More details?
Thank you for your reply.
Can you give me a bit more information.
I use pattern .*\t(.*)\.00\t.* , it is matching just the price part. In "replace with" I set $1 and tick "Extract matches". In subfilter I make a math, and then I just get a number of prices. How can I manage don't lose another parts of line and put the result of math into the line?
Also, can you give an example how to use TextPipe.setGlobalVar and TextPipe.getGlobalVar()? Or just tell me where I can read about it.
Thank you.
Can you give me a bit more information.
I use pattern .*\t(.*)\.00\t.* , it is matching just the price part. In "replace with" I set $1 and tick "Extract matches". In subfilter I make a math, and then I just get a number of prices. How can I manage don't lose another parts of line and put the result of math into the line?
Also, can you give an example how to use TextPipe.setGlobalVar and TextPipe.getGlobalVar()? Or just tell me where I can read about it.
Thank you.
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact: