type = 'yeast';
nattr = 8;
fstr = strcat(repmat(' %f',1,nattr),' %d');
pstr = strcat(repmat(' %.4f',1,nattr),' %d\n');
fid = fopen(strcat(type, '_training.txt'),'r');
c = textscan(fid,fstr);
fclose(fid);
c{1,nattr+1} = c{1,nattr+1} - 1;
fid = fopen(strcat(type, '_training_adj.txt'),'w');
for i = 1:size(c{1,1},1)
    exec = 'fprintf(fid,pstr';
    for j = 1:nattr+1
        exec = strcat(exec,sprintf(',c{1,%d}(i)',j));
    end
    exec = strcat(exec,');');
    eval(exec);
end
fclose(fid);
fid = fopen(strcat(type, '_test.txt'),'r');
c = textscan(fid,fstr);
fclose(fid);
c{1,nattr+1} = c{1,nattr+1} - 1;
fid = fopen(strcat(type, '_test_adj.txt'),'w');
for i = 1:size(c{1,1},1)
    exec = 'fprintf(fid,pstr';
    for j = 1:nattr+1
        exec = strcat(exec,sprintf(',c{1,%d}(i)',j));
    end
    exec = strcat(exec,');');
    eval(exec);
end
fclose(fid);
