mode(0); clearglobal(); // [RESU,Err]=mopen("D:\ETUDE_SCILAB\TRACTION\experimental_data\All-ice\fichiers.dat","r") ; record = mgetl(RESU); [number_of_lines,number_of_columns] = size(record); file_name = []; extension_name = []; k = 0; number_of_files = 0; // i = line number // j = dot localization // k = number of lines with a name for i = 1 : number_of_lines if (length(record(i)) <> 0) then dot_localization = 0; for j = 1 : length(record(i)) if part(record(i),j) == ascii(46) then // ascii(46) = dot nomber dot_localization = j ; end; end; k = k + 1; file_name(k) = part(record(i), 1 : dot_localization-1); extension_name(k) = part(record(i),dot_localization+1 : dot_localization+3); end end [real_number_files,nc] = size(file_name); printf('there are %d files \n',real_number_files); if (k == 0) then printf(' #### WARNING : the file is empty !!!! ######\n'); end