Need to print the first column values, when my row value is 1

Hi, I want to print for every row, from row 2 like this: based on the corresponding values in their rows

PAZ valid commands are => MLL, LOC

MLL valid commands are => MLL, LLP

LOC valid commands are => MLL, LOC

LLP valid commands are => MLL, LOC, LLP

Error:
n = $sscanf(fd,“%[^,],%[^,],%[^,],%[^]”,col[0],col[1],col[2],col[3]);
|
xmsim: *E,SYSFMT (./testbench.sv,38|25): $sscanf – Invalid format specifier ‘%[’.

module tb;
  int 	 fd; 			// Variable for file descriptor handle
  string line;
  struct {
    string name;
    logic[2:0] val;
  } mode[5];
  string col[4];
  int i;
  int n;
  
  initial begin
    
    fd = $fopen ("trial", "w");
    for (int i = 0; i < 5; i++) 
      if(i==0)
        $fdisplay (fd, "PAZ,MLL,LOC,LLP", i);
    else if(i==1)
      $fdisplay(fd,"PAZ,1,1,0",i);
    else if(i==2)
      $fdisplay(fd,"MLL,1,0,1",i);
    else if(i==3)
      $fdisplay(fd,"LOC,1,1,0",i);
    else if(i==4)
      $fdisplay(fd,"LLP,1,1,1",i);
    $fclose(fd);
           
    fd = $fopen ("trial", "r");    
    	while(!$feof(fd)) begin
           while($fgets(line,fd)) begin
			 $display("Data =%s",line);
             if(i==0)
               n = $fscanf(fd,"%d,%[^,],%[^,],%[^,],%[^]",col[0],col[1],col[2],col[3]);
             else
               n = $fscanf(fd,"%[^,],%[^,],%[^,],%[^]",mode[i].name,mode[i].val[2],mode[i].val[1],mode[i].val[0]);
             i=i+1;
		   end
        end
    
    $fclose(fd);
  end
endmodule



In reply to Geek_Woman:

Verilog/SystemVerilog supports only a limited set of formatting speciifications. Yuo can try reading the file a line at a time, and then using the split function below.

typedef string words_t[];
function words_t split (
  input string in,
  input byte separator = ","
);
  int index [$];
  index.push_front(-1);
  foreach (in[i]) 
    if (in[i] == separator) 
      index.push_back(i);
  split = new[index.size()];
  index.push_back(in.len);
   foreach (split[i]) 
     split[i] = in.substr(index[i]+1, index[i+1]-1);
endfunction