read the data and format