Hi! I’m trying to do something incredibly simple and I’m going nuts. I’m a complete programming newbie, and this is far too big for Excel.
Basically, I have a load of big CSV files, where the data looks as follows:
For any negative value, I want to move the “-” to the front of the string so that I can convert it to an integer.
I’m going nuts trying to do this with regex formulas: regexreplace($Net$,((?:\d+.)?\d+)-),-$1)
But having very little luck. Any help would be super appreciated!
The following pattern works in KNIME
Thank you so much! This absolutely works for individual cases, now I’m just missing some syntax that I’m not getting right.
I’m trying to apply this to a full column, doing the following:
regexReplace($Net$, ((?:\d+.)?\d+)(-?) ,$2$1)
I think having the $ around the 2 is somehow confusing it as I’ve already referenced $Net$, and I’m getting the following error: “Invalid settings: No such column: 2 (at line 1)”.
now i realize which Node you were using ;-). You need to use double backslashes as an escape sequence and quotation marks:
This worked for me. Hope it will work for you too
You’re absolutely wonderful. Can’t thank you enough- wish I could send some wine your way
Me too. I also wish you could do that!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.