Reading varying headerlines length, text files
古いコメントを表示
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
end
end
textForGUI = 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!
1 件のコメント
Matlab User
2016 年 8 月 23 日
編集済み: Matlab User
2016 年 8 月 29 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Sources についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!