Multiline values to single line

How can I combine a json’esque string values that are on multiple lines to a single line ?
the data is all in separate rows and there are a lot of groups like the following in the file, and those $value and include statements are repeating on each, with variations.

node ‘unique value’ {
include mandarin_1
include mandarin_1
include mandarin_2
include mandarin_3

Groupby cand handle that… I would like group all between “node” and “}” into single set ?

Hi there @miku,

Welcome to KNIME Community Forum!

If I got you right GroupBy node is a way to go only prior to that you need to prepare your data for it. To do that you can use Rule Engine node to assign unique identifier in new column to each row that has “{” sign and all other rows should have empty values. For unique identifier I used rowindex function from Rule Engine node. After that use Missing Value node with Previous value option that will populate other members of the same group. After that a bit of data manipulation in order to get some readable format. Here is workflow exampleon KNIME Hub:

Check it out and if any questions feel free to ask.



Yes! This solved it perfectly! Nice!

Thanks Ivan!


Glad it worked :slight_smile:

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