Sort List by part of Sublist Value

Hey all,

 

I’m trying to sort a list by part of the sublist value, is there anyway to pull out certain data from certain position and make them a list to sort the mainlist?

Any suggestion would be appreciated!

Thanks a lot.

 

Sublist

Hi,

how about this? (make sure the firtitem and lastitem node’s lacing is set to longest)

1 Like

Hi, if you transpose your list, Clockwork has a great node called List.SortListOfLists which works great.

Hi, mostafa, this is amazing! There are some empty value in my case(I think I could use boolmask to avoid it), but still it works perfectly, I really learned a lot from it!! Thanks a lot :wink: , wish you a good day!

Hi, Jostein,

the list.SortListOflists node was also my first try, but I didnt realize that I should transpose the list again, you opened my eyes ! :slight_smile:

Thank you guys for all the helpful answers!

Hi, Jostein,

I tried it again, unfortunately the list is not really sorted by the marked value with your solution, but still thanks a lot to teach me how to use the list.SortListOflists node!

1 Like

Hi, everyone, maybe you also have a idea, that we could add another filter or condition (such as level or function) to sort the list again. without breaking the existing order?

I made a bad example here, I use mostafas’ node to sort the list first by the “01,02,03”, then Im not sure if theres a way to use other index as " A,B,C" to sort the list again, so that we get {"00.01,“A”,“x”},{“00.02”.“A”.“y”}, …

Thanks!

 

 

Hey, Vikram,

Thanks for your solution, I also thought about editing the string, but didnt know how, thats really effektive!

Hi Fan Zhou,

here’s a proposition. I’m not sure it’s the best way but it works

Hi, MOSTAFA EL AYOUBI,

I think I didnt describe my question correctly, but still thanks a lot for your proposition.

I was trying to export a roomlist and reorder them first by level (index 1) and then by room number (index 0), your first proposition has already helped me to odered them by room number. Now I m trying to use filter or booleamask to separate the items into several sublists level 1,level 2,… and then combine them again.

I think your last proposition could also do the job with small modification, I would also try myself :slight_smile:

Here is an example of sorting (and grouping) first by index 0 of sublists and then by index 1 of sublists

File: SortTwice.dyn

20160407-6

Hi, VIKRAM SUBBAIAH,

I didnt know there’s a group node, and your proposition works great!

Thank you very much :slight_smile:

This link and picture seems to be broken :confused: