Hello there
i have a funny behiavor of the sort fonction, i try it out on different Solaris machine and i have the same issue.
So i would like to see if there is a rationel explanation
here is some data in a file:test.txt
,Test,RSD,RSD_Asset
,Test,RSD,RSD_Credit
,Test,RSD,RSD_Liab
,Test,RSD,VA,VAFA,VAFA_Asset
,Test,RSD,VA,VAFA,VAFA_Credit
,Test,RSD,VA,VA_Liab
,Test,RSD,RSD_Mort
,Test,RSD,RSDA
,Test,RSD,RSD_Oper
,Test,RSD,VA
,Test,RSD,VA,VAFA
,Test,RSD,VA,VAFA,VAFA_Liab
,Test,RSD,VA,VA_Asset
now if i sort that file, i receive this
sort test.txt
,Test,RSD,RSDA
,Test,RSD,RSD_Asset
,Test,RSD,RSD_Credit
,Test,RSD,RSD_Liab
,Test,RSD,RSD_Mort
,Test,RSD,RSD_Oper
,Test,RSD,VA
,Test,RSD,VA,VA_Asset
,Test,RSD,VA,VAFA
,Test,RSD,VA,VAFA,VAFA_Asset
,Test,RSD,VA,VAFA,VAFA_Credit
,Test,RSD,VA,VAFA,VAFA_Liab
,Test,RSD,VA,VA_Liab
and here are a couple of strange things happening
1:
if you look the start of the file
,Test,RSD,RSDA
,Test,RSD,RSD_Asset
,Test,RSD,RSD_Credit
it seem that the charactere "_" is sorted after the alphabete (that is what i want)
2: but if you look further
how come
,Test,RSD,VA,VA_Asset
is before
,Test,RSD,VA,VAFA
and how come
,Test,RSD,VA,VA_Liab
is not next
,Test,RSD,VA,VA_Asset
I am getting crazy ????
I will like to have the following output (which make the more sence for the sorting fontion)
,Test,RSD,RSDA
,Test,RSD,RSD_Asset
,Test,RSD,RSD_Credit
,Test,RSD,RSD_Liab
,Test,RSD,RSD_Mort
,Test,RSD,RSD_Oper
,Test,RSD,VA
,Test,RSD,VA,VAFA
,Test,RSD,VA,VAFA,VAFA_Asset
,Test,RSD,VA,VAFA,VAFA_Credit
,Test,RSD,VA,VAFA,VAFA_Liab
,Test,RSD,VA,VA_Asset
,Test,RSD,VA,VA_Liab
thanks for your comments!!!
i am using
SunOS talos 5.10 Generic_147440-12 sun4u sparc SUNW,Sun-Fire-V490