Skip to content

Instantly share code, notes, and snippets.



Last active Aug 27, 2015
What would you like to do?
function pairs = readzmax(FileName)
fileID = fopen(FileName);
% read the file data
vals = fileread(FileName);
% 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');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.