Simple CSV parser to rearrange the data