read a csv file and compute data