function mzxmlConvert();

d=dir;

prog = ['progress out of ', num2str(size(d,1)-2)];
disp(prog)

for i = 3 : size(d,1)
       
    f = [pwd, '\', d(i).name, '\1\1SRef\new.mzXML'];
    g = [d(i).name,'.txt'];
           
    out = mzxmlread(f);
    m = out.scan.peaks.mz(1:2:end);
    z = out.scan.peaks.mz(2:2:end);
    data = [m,z];
    
    fid = fopen(g,'w');
    fprintf(fid, '%6.4f %12.4f\n', data');
    
    p = [num2str(i-2), ' / ', num2str(size(d,1)-2)];
    disp(p)
    
end


