Row Filter

Hi Knime Experts!!

Hope you all are doing well.

Just need your help in filtering out certain rows:

Bascially i am having data as follows:

Input data:
9852
9875
7393.32-
410.74-
821.48-
4928.88-
1232.22-
1232.22-
410.74-
12732.94-
11500.72-
6571.84-
1642.96-
1642.96-
2875.18-
1642.96-
6571.84-
3696.66-
3285.92-
1642.96-
2464.44-
9036.28-
1642.96-
4107.40-
3696.66-
2875.18-
4518.14-
18894.04-
821.48-
2875.18-
2053.70-
821.48-
3696.66-
410.74-
3285.92-
2053.70-
3696.66-
4518.14-
1232.22-

I just want to bring “-” sign ahead of digits.
Output:

9852
9875
-7393.32
-410.74
-821.48
-4928.88
-1232.22
-1232.22
-410.74
-12732.94
-11500.72
-6571.84
-1642.96
-1642.96
-2875.18
-1642.96
-6571.84
-3696.66
-3285.92
-1642.96
-2464.44
-9036.28
-1642.96
-4107.4
-3696.66
-2875.18
-4518.14
-18894.04
-821.48
-2875.18
-2053.7
-821.48
-3696.66
-410.74
-3285.92
-2053.7
-3696.66
-4518.14
-1232.22

Thanks,
Ravi

Unless I’m missing something, this is not filtering.

There are probably several ways to accomplish your goal.
One general approach is to:

  1. tag each row that contains a “-” using either a Rule Engine node or a Column Expressions node.
  2. use a String Manipulation node or a Column Expressions node to remove the “-”.
  3. use a String Manipulation node or a Column Expressions node to add a “-” to the beginning of the values in the rows you tagged initially.
3 Likes

Hello @ravi13,

see here for one node regex solution:

Br,
Ivan

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.