On 5 October 2012 18:49, ohshitgorillas <
atom.go...@gmail.com> wrote:
> I'm looking to export all of my peak data at once. Is there a way to do this
> for multiple files? I am working with large datasets, sometimes 50 files or
> more, and it would be nice to be able to export all peak parameters to
> individual files, named after the dataset. Is there a way to do this or do I
I remember similar question some time ago. I think it was not possible
at that time.
It's possible using Lua, unfortunately switching between Lua and fityk
script makes it a bit complicated.
Fityk 'lua' command interprets the rest of the line in Lua. (It's also
possible to write whole script in lua and then run it using "exec
myscript.lua".)
=-> lua F:out('hello')
hello
(hello is printed in the output panel.)
=-> lua F:out(F:get_info('filename', 0))
/home/wojdyr/local/share/fityk/samples/enso.dat
=-> lua F:out(F:get_info('filename', 1))
/home/wojdyr/fityk/samples/nacl01.dat
=-> @*: lua F:out(F:get_info('filename', F:get_default_dataset()))
/home/wojdyr/local/share/fityk/samples/enso.dat
/home/wojdyr/fityk/samples/nacl01.dat
let's remove extension .dat (if this is the extension) and add .out:
=-> lua F:out(F:get_info('filename', 0):gsub('.dat$', '') .. ".out")
/home/wojdyr/local/share/fityk/samples/enso.out
the final command is:
@*: lua F:execute("info peaks
>'"..F:get_info('filename',F:get_default_dataset()):gsub('.dat$','')..".out'")
I must add some syntactic sugar to make it simpler.
M