hello Marcus
here you are, simple code shipset :
Filename = 'html_table.txt';
[myDate, myDiagnostic] = extract_data(Filename)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [myDate, myDiagnostic] = extract_data(Filename)
fid = fopen(Filename);
tline = fgetl(fid);
% initialization
k = 0;
p = 0;
q = 0;
k_parameter = 0;
q_parameter = 0;
myDate = [];
myDiagnostic = [];
while ischar(tline)
k = k+1; % loop over line index
% retrieve line Date/Time
if contains(tline,'Date/Time')
k_parameter = k;
p = p+1;
end
if p>0 & k == k_parameter + 3
myDate = [myDate; cellstr(tline)];
end
% retrieve line Date/Time
if contains(tline,'Diagnostic')
q_parameter = k;
q = q+1;
end
if q>0 & k == q_parameter + 3
myDiagnostic = [myDiagnostic; cellstr(tline)];
end
tline = fgetl(fid);
end
fclose(fid);
end
gives following results :
myDate =
3×1 cell array
{'2021-01-20 18:17'}
{'2021-01-20 18:16'}
{'2020-12-10 22:44'}
myDiagnostic =
3×1 cell array
{'LARGE PT'}
{'LARGE PT'}
{'LG PT' }