Cell with multi-line data

Hi all,

I have a very ugly database and one cell is multi-line (aka there are \n’s in a cell) it looks like this:
aaa-server-01
aaa-server-01.eth0
aaa-server-01.eth1
aaa-server-02
bbb-server-05.eth0
bbb-server-05.eth1

…you get the picture.
I have filtered the column and I’d like to get all the unique server names in separate columns…something like:
| aaa-server-01 | aaa-server-02 | bbb-server-05 |

Is this possible with the available nodes or should I script it?
Thanks for all little help in advance,
JT

You can use cellsplitter node to split your cell using \n as separator.
Use list output in cell splitter node.

Next you can append ungroup node to have unique row for every element in list.

At the end you can append a groupby node to select distinct hostnames.

2 Likes

Thanks for the quick response pigreco
Sorry, I wasn’t perfectly clear. I’d like to see a unique list of the server names only and not the elements…
Somewhere in the WF i should cut the .eth0 .eth1…etc off and then ungroup? I can do it but it seems a bit over-complicated.
In this short period since I’ve been using KNIME I noticed how powerful it is and I’m just wondering if there is a simpler way to do it.

1 Like

Ok. No problem
Last question:

This the content of a single cell or this is a cell
aaa-server-01
aaa-server-01.eth0
aaa-server-01.eth1

and this is another one?

bbb-server-05.eth0
bbb-server-05.eth1

By your example I didn’t understand if you have one row with many lines or many rows and many lines.
Thanks

Yupp… it’s confusing and I did not explain properly. Let me try it again :slight_smile:
cells:
{aaa-server-01
aaa-server-01.eth0
aaa-server-01.eth1 }

{aaa-server-02
bbb-server-05.eth0
bbb-server-05.eth1}

{xxx-server-10
xxx-server-11
xxx.sever-11.eth0
xxx.sever-11.eth1}

the regex for the relevant part is: “^.{3}-server-[0-9]{2}”
What I need just a unique list of the servers, without the “eth[0-9]” part that I can just count

Thanks for your help

Try this one:
23469_pigreco_group.knar (18.5 KB)

3 Likes

Thank you very much. Yes, this is exactly what I needed.
Now, it’s totally obvious :slight_smile:

2 Likes

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