Maybe I am not getting what you are trying to say. Could you explain it a bit more?
Quote:
For example, Faroe Island can be a value of 1 column
Faroe Island is being treated as 1 below.
Alpha,121,island
Alpha Zulu,21,island
Faroe Island,20,island
japan,19,airline
japan,19,test
I assumed that you mainly have 3 columns.
Text Number Text, columns are space separated but, because columns 1,3(text) can contain spaces, you can't use space as delimiter. Sed code above checks for space before & after column 2(Number) and changes it to ",". It ignores the spaces that occurs in 1st and 3rd. Once that's done, you can sort values using "," as delimiter. Most imp. assumption is that second column is number and is separated by space from 1st and 3rd.
I am not aware of sorting based on char position. If someone knows it I would be glad to learn.