Hi, I am trying to read specific part of the header lines for these files and once I read lines i want to increment for each block and display them into GUI edit text boxes.
fid= fopen([FilesToRead, MultipleFiles]);textForGUI = cell(1);while true tLine = fgetl(fid); headerCells = strsplit(tLine,' '); if length(headerCells) > 1 if ~isempty(headerCells{2}) if ~strcmpi(headerCells{2},'!User') && ~strcmpi(headerCells{2},'data') textForGUI(end+1) = headerCells(2); else break end end endendtextForGUI = textForGUI(2:end);Block=0;while true tLine = fgetl(fid); if ~ischar(tLine) break; end if ~isempty(strfind(tLine,'data')) Block=Block+1; if true % code
end formatSpec = '%f %f %f %f %f'; C = textscan(fid,formatSpec,24,'CommentStyle','data','Delimiter','\t'); %here I got some calculations and plots
end end
Thanks!
Best Answer