I have a txt file containing lines as follows (the first field is keywords, the second field is frequency of keywords, and the third field is related texts):
anorexia nervosa 1 在专利网看到一
glaucoma 10 want to suck out my eyeballs and have them replaced with
cancer 691 there is a drug that helps fight cancer called avastin
gene therapy 1 writing a review paper on gene therapy
hormone 35 glad my hormone injections end in a month
depression 259 depression? just made depression cake: recipe here
I want to parse the file like this (keywords sorted by those of keywords' frequency):
cancer 691
depression 259
hormone 35
glaucoma 10
anorexia nervosa 1
gene therapy 1
I check other questions about sort and order problem but I couldn't find any good example. sort() doesn't seem to be worked. Please let me know good start point!