filename="Sample.txt";

infile=fopen(filename,'rt');    % open the file for reading, in text mode

c=blanks(20);x=zeros(1,20);n=x; % prealocate the memory

for k=1:3             % read and dump the three header lines
  tline=fgetl(infile);
endfor


k=1;                  % initialize the data counter

tline=fgetl(infile);
while (!is_scalar(tline))   % if tline=-1, then we reached the end of the file
  [ct,xt,nt]=sscanf(tline,"%1c%g%i","C"); % scan the string
  c(k)=ct; x(k)=xt;n(k)=nt; % store the data in the allocated vectors
  tline=fgetl(infile);      % read the next line
  k++;                      % increment the counter
endwhile

fclose(infile);

c=c(1:k-1);x=x(1:k-1);n=n(1:k-1);  % use only the read data
c
