mirror of
https://github.com/njchorda/MATLAB-Touchstone-Reader.git
synced 2026-02-25 02:50:45 -05:00
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:
@@ -125,7 +125,10 @@ classdef SPARAMS < handle
|
|||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
txt = strtrim(txt);
|
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 = regexprep(txt, '\t+', ' '); %Remove all tabs and replace with s single space (dealt with in next line)
|
||||||
txt = strtrim(txt); %Remove trailing whitespace
|
txt = strtrim(txt); %Remove trailing whitespace
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user