I have a list with IP address, role and group. I want to firstly sort the the entire list with its group number. And based on the new list, for each group, I want to sort again by the role. Finally, based on the former sort, sort again by the IP address. I can't find a way to achieve my goal and struggle in it for a couple hours, please help, thank you in advance.
for example, the list is like:
{
<192.168.1.1, 1, "group 2">,
<192.168.1.3, 1, "group 1">,
<192.168.1.7, 2, "group 1">,
<192.168.1.25, 2, "group 1">,
<192.168.1.1, 2, "group 2">
}
Ideally, after three sorts, the output should be something like:
{
<192.168.1.3, 1, "group 1">,
<192.168.1.7, 2, "group 1">,
<192.168.1.25, 2, "group 1">,
<192.168.1.1, 1, "group 2">,
<192.168.1.1, 2, "group 2">
}