Hello Everyone,

I am working in an assignment and part of this assignment is to input a CSV file with floats such as this:

8.5, 10.5, 90.5
49.5, 99 ,97
88, 70, 100
78, 2, 10
into an universal variable array.I just want to figure out a way to simply input the CSV file into a 2D variable array.The values in the array will be later use in functions that I'm trying to figure out but I can't do that until I store these values in the array. I think is just a matter of figuring out how to tell fscanf to ommit spaces and commas, but I don't know how. I am a beginner and I have try everything. If any of you could help me with this problem, I would appreaciated a lot.

Thank you very much

This is what I have done

[======================================

Code:
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
float grades[1001][101];

int main(int argc, char* argv[]){ 
  int i,j; 
  int num_student,num_assig; 
  FILE *input_file; 

  num_student = atoi(argv[1]);
  num_assig = atoi(argv[2]); 

   if( argc > 3 || argc < 3){
 printf("usage: ./a.out num_students      num_assignments\n");    return(0); 
   } 

           input_file = fopen("grades.txt","r");

        for( i = 1; i < num_student; i++){
   for( j= 1; j < num_assig ; j++){
   fscanf(input_file,"%f, ",&grades[i][j]); 
   } 
   }    
       printf("Assignment 1 of student 1 = %.1f\n",grades[1][1]);
    printf("Assignment 2 of student 1 = %.1f\n",grades[1][2]);
    printf("Assignment 3 of student 1 = %.1f\n",grades[1][3]);
    printf("Assignment 1 of student 2 = %.1f\n",grades[2][1]); 

          fclose(input_file);
}


================================================== ========]

The output is this

Assignment 1 of student 1 = 8.5
Assignment 2 of student 1 = 10.5
Assignment 3 of student 1 = 0.0
Assignment 1 of student 2 = 90.5

I think I'm close to solve it but something is missing the output should look like this

Assignment 1 of student 1 = 8.5
Assignment 2 of student 1 = 10.5
Assignment 3 of student 1 = 90.5
Assignment 1 of student 2 = 49.5