Output Array to CSV

So I have an array portfolio [i][j] where i and j are determined by inputs by the user. I can get the code to fill the array with the correct values; however, I can not figure out how to output the array to csv.

Is there a simple way to output to a csv? Is it easier to create the csv file and just write to it?

This is all I have so far:

for( i=0; i<sizevol; i++){
for(j=0; j<sizespot; j++){
myfile.open ('')
}
}
You do not want to reopen the file each time you loop. IIRC the file is created if it doesn't exist.
CSV files do not have a standard.
Just write an element and a comma, then an element and a comma, etc
Topic archived. No new replies allowed.