merge data, write to csv.