From f1a55ffedd955ead76f8dfdaf4ad7ea6d78cd2cd Mon Sep 17 00:00:00 2001 From: Nathan <38429786+njchorda@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:03:30 -0400 Subject: [PATCH] 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. --- SPARAMS.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SPARAMS.m b/SPARAMS.m index 42a5789..253add2 100644 --- a/SPARAMS.m +++ b/SPARAMS.m @@ -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