I've seen a lot of answers on how to sort email list by domain. What I need is different. All I have is a list of domains and sub-domains that need to be sorted properly. As you may know, a domain hierarchy begins at the end, meaning first comes the .com, then the domain and then the suffix, e.g. "www" So, I need to group them by relevance. For example, I have the following domains:
www.somedomain.com
www.someotherdomain.co.uk
www.yetonemoredomain.org
sub.somedomain.com
1.somedomain.com
2.yetonemoredomain.org
3.someotherdomain.co.uk.
www2.yetonemoredomain.org
mail.someotherdomain.co.uk
Plain sort from A to Z will start from left to right, but I need it to be sorted from right to left, with the dot as a field separator. I know a simple bash command can do it but I need it in Excel. I was thinking about using "Text to columns" and separating by dots and then sorting columns as needed, but this may also cause some troubles with columns creation for 4th level domains and higher, such as x.y.x.somedomain.com. Columns will be created from left to right, this means the .com may fall into different columns instead of being the rightest column. I'm sure there must be a better way for doing this. Thanks in advance for your help. Ziv