Hi I have data in the following format that I need to write to a csv file.

Student1 Mark1 Mark2 Mark3 Mark4 Mark5
Student2 Mark1 Mark2 Mark3 Mark4 Mark5
Student3 Mark1 Mark2 Mark3 Mark4 Mark5
Student4 Mark1 Mark2 Mark3 Mark4 Mark5
Student5 Mark1 Mark2 Mark3 Mark4 Mark5

I am writing my code in C. Any ideas on how I can do this?

A csv file format is just comma or tab separated fields. If a field may contain commas or tabs then the field should be enclosed in quotes

For example:

Joe,90,100,50,95,98
Mark,40,50,60,70,80,90