I got around this using a loop and copying the txt file before calling dynare, while always keeping the same name for the txt called inside the .mod file:
for iX = 1:length(xx)
infile = strcat('matfiles/testModel_', num2str(xx(iX)), '.txt');
copyfile(infile, 'matfiles/testModel.txt');
dynare testModel nolog % here I always call load_params_and_steady_state('testModel.txt')
end