Add files via upload

Changed the way comments are handled. Uses strsplit() to separate all lines and then removes ones that start with an exclamation point. Replaces a regex method.
This commit is contained in:
Nathan
2025-06-18 18:03:30 -04:00
committed by GitHub
parent 5671481c95
commit f1a55ffedd

View File

@@ -125,7 +125,10 @@ classdef SPARAMS < handle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
txt = strtrim(txt);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
txt = regexprep(txt, '![\s\S]*?!|([^:]|^)!.*$', '', 'lineanchors', 'dotexceptnewline');
% txt = regexprep(txt, '![\s\S]*?!|([^:]|^)!.*$', '', 'lineanchors', 'dotexceptnewline');
lines = strsplit(txt, '\n');
filteredLines = lines(~startsWith(lines, '!'));
txt = strjoin(filteredLines, '\n');
txt = regexprep(txt, '\t+', ' '); %Remove all tabs and replace with s single space (dealt with in next line)
txt = strtrim(txt); %Remove trailing whitespace