split the data into separate file after encountering a column name