patrick227 Hello everybody, I kindly ask for support. The task is the batch-fitting of some XRD in situ data in Topas (raw-files). I tried to modify a solution with a bat-file creating a simple loop as counter for the range number. The idea is to define the starting parameter once, for the first file and then run the whole batch with an input file for a single fit and an external counter. The input-file looks like that: r_exp … do_errors RAW(D:\path\samplename _001, RANGE_NUMBER) r_exp … bkg @ … str … str… xo_Is… The fit is executed in the command window using the file batch.bat located in C:\Topas\.... and looking like this: @echo off for /L %%N IN (1, 1, 2) DO ( C:\Topas4\tc.exe D:\path\samplename_001.inp "macro RANGE_NUMBER{%%N}" copy "D:\path\samplename_001.out" "D:\path.samplename_001.inp") But I am afraid that I understand something wrong and that this solution is not suitable for our task. We have around 100 single raw-files per experiment, all separated raw-files in the format: samplename_001.raw, samplename_002.raw … samplename_100.raw. The bat-file is counting correctly and for the first raw-file the fit runs without problems but unable to continue with a second one. The Error message is: "Error reading file". I think it is a problem with the format, but I dont understand the functionality of a "range" at all, and especially in comparison to a single raw-file. Therefore I have the following questions: Is there a possibility to use the “range”-function to fit all raw files in a series? (Or) Is it possible to integrate an external counter into the path of the raw-file? Like a variable, using the loop to change the name of the raw-file. Thanks in advance for any support. Cheers Patrick
johnsoevans Patrick, Can you use the method at: http://topas.dur.ac.uk/topaswiki/doku.php?id=automating_multiple_refinements It's relatively straightforward to feed in different filenames using macros. John
patrick227 Thank you John, With that link I was able to solve my problem with the batch-fitting. Now, my bat-file looks like that: @echo off for /L %%H IN (0 , 1, 1) DO ( for /L %%Z IN (0, 1, 9) DO ( for /L %%E IN (0, 1, 9) DO ( C:\Topas4\tc D:\path\inpfile "macro FileName{D:\path\filename_%%H%%Z%%E} #define GUI_LINES" copy "D:\path\inpfile.out" "D:\path\inpfile_%%H%%Z0.inp" ) ) ) Maybe there is a possibility to do that more gentle, but it is working well. Cheers Patrick