function pairs = readzmax(FileName) | |
fileID = fopen(FileName); | |
% read the file data | |
vals = fileread(FileName); | |
fclose(fileID); | |
% Convert to string | |
dstr = sprintf('%s',vals); | |
% keep only lens data | |
GLDstart = regexp(dstr, 'GENEARL LENS DATA:','end'); | |
dstr = dstr(GLDstart+2:end); | |
Fieldstart = regexp(dstr, 'Fields','start'); | |
dstr = dstr(1:Fieldstart-2); | |
lines = regexp(dstr, '\n', 'split'); | |
% parse the lines into name/value | |
pairs = regexp(lines, '(?<name>[^:]*):\s*(?<value>\S*)', 'names'); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment