0

Assume we have a file called 'teams.csv'. We want to do the operation below to all the rows in the file 'teams.csv' and return a file with the same name but now with only 3 columns instead of 5. And we also need to name our new column 'sport'. In the file '***' indicate that a person does not play that particular sport.

I have a CSV with the following columns:

old table

And want the CSV file with only 3 cols as shown below

new table

1 Answers1

0

You could use something like this answer to create a list of objects based on the contents of the CSV file, manipulate the data as necessary and then write back to the CSV file.

Sharing the code you have already tried would also be a good idea ;-)