i got a pretty big String of lat and lon coordinates in brackets. Now i would like to remove every second bracket to reduce the length of the string.
So far i unfortunately couldnt find a solution. Example in the following:
A) → B)
Hi @NilsAhr and welcome to the KNIME forum !
You could do in this order as follows, just using KNIME nodes :
- Cell Splitter : Convert your long string into a list, splitting the string by the comma separator as delimiter. Make sure that the resulting format you chose is “List”. This should generate just one extra column.
- Ungroup : Ungroup this column. The result should be as many rows as coordinates you have in your initial list.
- Math : Calculate whether the row index is odd or even and create a column with this result, i.e. 0s (even) and 1s (odd).
- Rule-Base Engine Splitter : Keep only ODD rows (RowId is odd).
- GroupBy : Group the remaning rows using GroupBy node and aggregate using “Concatenate” with a comma separator.
This should do the trick
Hope this helps,
thanks a lot!
Problem is solved!
Great news. Glad it worked !
If you are happy with this solution, would you mind please to validate my answer ? There is a box to check for this. It will help people to search and reach the “solved solutions” more easily
Thanks in advance !
Thanks @NilsAhr for validating !
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.