2021年5月5日星期三

Looking to sort a list of servers by last letter before a number

I'd like to sort lines from a file that will allow me to sort alphabetically based "only" on the last letter before a number appears in a line. The numbers will only show up in the middle of a string. There is no limit to the amount of numbers or letters.

Example:

abcdef123ghi  abcd456efghijklm  ab24578cdef  

I would expect the output of these 3 lines to come out as follows:

ab24578cdef #(alphabetically based on the "b")  abcd456efghijklm #(alphabetically based on the "d")  abcdef123ghi #(alphabetically based on the "f")  

Thank you for any help!!!

https://stackoverflow.com/questions/67407517/looking-to-sort-a-list-of-servers-by-last-letter-before-a-number May 06, 2021 at 03:20AM

没有评论:

发表评论