helper function for creating dat file

collapse_row(data)