Sort (string) node question

quick question about the sort string node,
I have a spread of text from a csv that has a certain order.
I need to check for duplicates and delete them, without changing the given order.
The sort node seems the way to go, but it changes the order even when all its parameters are set to 0

why is that so? There are other ways?

Edit: Managed to get my order back by adding a Sort(spread) to the index of Sort(string), a GetSlice(string) takes the old spread and the newly ordered index give back the new spread in the correct order without the duplicates.

Still I don’t understanding if the way I’m going right now is correct or I’m not understanding the Sort(spread) correctly.

Occurrence (String) can do that for you.
‘Unique’ gives you the first of every duplicate slice, and ‘First Occurrence’ the index of that within the input spread. so no need to sort and resort, since the node processes the inputs slices sequentially in input order.
there are two additional hidden pins which give you more info in case you want another than the first duplicate

1 Like

you can also have a look at Distinct (String)

A small note. Unique pin returns a spread containing every value in input, but the values are inserted just one time; no matter if the value is duplicated or not. It does remove the duplicates, but also returns values that have a single occurrence.
In other words, if fed with [a,b,b], it would return [a,b].

Thanks everyone, I think @woei 's node is the most useful for me in this situation!

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