> -- start code. broken in to sections because you cannot do a for loop with
> leading zeros (to the best of my knowledge at least)
> for f=1,9 do
> filename = string.format("file-000%0d.xy", f)
You may specify number of digits in the format, and 0 to fill missing
digits with 0's not spaces, for example
> = string.format("%05d", 123)
00123
> = string.format("%05d", 1234)
01234
So the beginning of the loop could look like this:
for f=1,8000 do
filename = string.format("Mg20A_%05d.ge2.txt", i)
It may not help OP though, because version 0.9.8 has no Lua.
One workaround may be to first generate large fityk script that
repeats the same 8000 times, and then run this script.
For example, this Python script produces fityk script with 8000 x 5 lines.
#!/usr/bin/env python
f = open("big_script.fit", "w")
for n in range(1, 8000):
f.write("""
@0 < Mg20A_%06d.ge2.txt
guess %%f = Gaussian
fit
print %d, %%f.center, filename >> results.txt
""" % (n, n))
Cheers
Marcin