Read and write flight data from text file