read file and sorting