|
Problem in sorting the file
file format is
word filename no.of occurances
------------------------------
wish f3.txt 2
wish f2.txt 1
cold f1.txt 5
cold f2.txt 3
cold f1.txt 3
cold e.txt 3
gold f1.txt 7
gold f3.txt 3
rush e.txt 2
itz abt building a search index for every word in the files given as input
the first column is the word 2nd is filename 3rd is no of occurances of that word in each file
no my prob is i have to sort the file as
if word is same i have to sort the file with no of occurances
i.e 3rd field in descending order
if both word and noof occurances are same
i have sort the file based on second field in alphabetical ascending order
thannks in advance
|