Convert the file to a pandas Dataframe and write to csv file.