Page 1 of 1

Make value inside line negative and viseversa

Posted: Mon Feb 22, 2021 2:12 pm
by XJAC
Hi,

I need some help from someone with more experience than me concerning the regular expressions

I have text files that are automaticaly generated in another software, and want to change the value inside it from negative to positive and viseversa.

The example:
Search is always the same: Find the second decimal value in this line, so 'SetSuctionCupPosition(X,' is always in the beginning. Then I want the value -100 to become 100; The part after the second comma stays the same.
So Search =

Code: Select all

SetSuctionCupPosition(3,-100,0,"H75-M-145x145");
Replaced result =

Code: Select all

SetSuctionCupPosition(3,100,0,"H75-M-145x145");
And the opposite:
Search =

Code: Select all

SetSuctionCupPosition(3,100,0,"H75-M-145x145");
Replaced result =

Code: Select all

SetSuctionCupPosition(3,-100,0,"H75-M-145x145");
Can somebody provide the search replace expression to obtain this?

Many thanks in advance!!