Skip to content
Snippets Groups Projects
Commit edd66d6b authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

check if we are is the right paragraph context for global attributes

parent 9df3a458
No related branches found
No related tags found
No related merge requests found
......@@ -49,30 +49,38 @@ while ~feof(fid)
context = match{1}{1};
end
% Iterate from each element from object nca and additional variables
% ------------------------------------------------------------------
for ii = nca_keys
% get key, use char because i is cell
% -----------------------------------
clef = char(ii);
% construct regex with pair cle=value
% and extract value
% ------------------------------------
regex = strcat('^\s*', clef, '\s*=\s*(.+)$');
match = regexp( str, regex, 'tokens');
% check if we are is the right paragraph context
% ----------------------------------------------
if strcmp(context, 'GLOBAL') || strcmp(context, 'GENERAL') || ...
strcmp(context, tsg.TYPE_TSG) || strcmp(context, tsg.TYPE_TINT)
% build tsg struct
% ----------------
if ~isempty(match)
%if isnan(str2double(match{1}{1}))
tsg.(clef) = match{1}{1};
%else
% tsg.(clef) = sprintf('%f',str2double(match{1}{1}));
%end
continue
% Iterate from each element from object nca and additional variables
% ------------------------------------------------------------------
for ii = nca_keys
% get key, use char because i is cell
% -----------------------------------
clef = char(ii);
% construct regex with pair cle=value
% and extract value
% ------------------------------------
regex = strcat('^\s*', clef, '\s*=\s*(.+)$');
match = regexp( str, regex, 'tokens');
% build tsg struct
% ----------------
if ~isempty(match)
%if isnan(str2double(match{1}{1}))
tsg.(clef) = match{1}{1};
%else
% tsg.(clef) = sprintf('%f',str2double(match{1}{1}));
%end
continue
end
end
end
% check if we are is the right paragraph context
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment