Sort files based on their extension