Hi Oszkoa,
Here is one way to do what you want:
1> Import all files using the multiple ASCII import dialog, setting each file to be imported as additional columns in the worksheet (which I gather is what you are doing now).
2> Keep your imported worksheet active
3> Now open the script window
4> Copy and paste the lines of script code from below, into the script window
5> Click and hold the mouse button and select all the lines of code you just pasted
6> Hit the enter key - this executes all the lines of code
This will change the label of columns corresponding to each file, to the file name (minus the file path and file extension). In this script segment I am assuming that there are two columns of data corresponding to each file. You may need to change that.
If your situation is more complicated, and this (or some simple modification) does not work, please post again.
Easwar
OriginLab.
// Script starts here------------
// Get the number of files that were imported
iNum=fdlog.multiopen.count;
// Loop over each file number
for(ii=1; ii <= inum; ii++)
{
// Get the file name
fdlog.get(a,ii,1);
// Assume each file added two columns to the worksheet
jj=(ii-1)*2+1;
// Change label of 1st col for this file to file name
wks.col$(jj).label$=%a;
// Change label of 2nd col for this file to file name
wks.col$(jj+1).label$=%a;
}
// Script ends here -----------