process raw data to csv with scala