Load several functions from one file | split string

Hi, this may be a stupid question, but I couldn’t find anything elsewhere.

Suppose I have a csv file with a given number of rows, each representing a function. So the something like

0.0,0.0,0.0,0.0
1.0,1.0,1.0,1.0

Inside FreeFEM I have a mesh with four elements, and I dont know how to load them.
I could separate the rows into different files (and putting them in a single column), and read line by line.
Something like

0.0
0.0
0.0
0.0

for file1 and

1.0
1.0
1.0
1.0

for file2. However this is not optimal since, in reality, I have a lot of functions.

What is the best way to load them?

I think the best way would be to read row by row and somehow split each one by the character ‘,’.
However, I couldn’t figure it out . . .

if you read in on file and you do not close the file ,
no problem

do like this ( not test)

int nbcolum = 4; 
ifstream fcvs("file.cvs");
func ifstream skipcomma(ifstream &ff)
{
    
    while(1)
    {
    int where = ff.tellg(); // store file position 
    string comment;
    ff >> comment; 
    if ( ! ff.good() ) break; 
    if( comment(0:0)!=",") 
     {
        ff.seekg(where); //restore file position 
        break;        
    }    
    }
    return ff;
}
func real[int] ReadRow(ifstream  &fcvs)
{
  real[int] row[nbcolum]; 
 for (int i=0; i< nbcolum;++i)
  { 
     skipcomma(fcvs);
      fcvs >>row[i]; 
  }
}
Vh data1 = ReadRow(fcvs);
Vh data2 = ReadRow(fcvs);
... 

Mmmm ok . . .

I was thinking, since I will make a lot of calls to the script, is it possible to pass a whole array as parameter instead?

remark, you can make an array of finite element function
like:

Vh[int] au(100);
for (int i=0; i<100;++i)
 au[i][]= ReadRow(fcvs);