...how to import consecutive filenames into OriginIn my view, the hard part is how to tell Origin which is the following filename.
I did it this way:
def GetNewName { /*Increases extension in %A: from lala.010 to lala.011*/
%K=1%[%A,>"."]; /* %K gets the value 1 followed by the file extension*/
%K=$($(%K)+1); /* The value of %K is increased (e.g.from 1000 to 1001)
%K=%[%K,>"1"]; /* Only characters after the first 1 remain (001) */
%A=%[%A,"."].%K; /* Finally, %A substitutes its extension by %K */
}
GetNum (Number Of Data Files) DataFiles; /*Number of files to be imported */
GetFile -w *.*; /* Open the first file (%A) */
repeat DataFiles{
document -t mytemplate.otw; /* Open template */
open -w %B%A; /* Import data from file %A (%B:path)*/
window -r %H %A; /* Rename worksheet to %A */
PlotData; /* macro for plotting */
GetNewName; /* macro for getting new file name */
win -i; /* iconize current worksheet*/
}
This script asks for the number of files to be imported, and for the name of
the first file (%A). The file is imported into a template and plotted (you can
define your options in macro PlotData).
Then, the following filename is choosen in macro GetNewName: the idea is to
have an index varible starting at 1000. Each time a new file is selected, the
index counter is increased, 1001, 1002, 1003... The filename is constructed
using the last 3 characters, that is, 001, 002, 003 and so. In this case, it
was the extension that was changing from one file to the following.
I hope it helps
Juanma