readDistances function to read 3 column file with distances