A script using the following code:
// Open files and place them in new, seperate worksheets
fdlog.path$ = "C:\MATLAB71\PIMS\"; // set fdlog's default path
fdlog.ShowComment = 0;
fdlog.UseGroup(Ascii);
if (fdlog.MultiOpen() != 0/0);
{
loop (ii, 1, fdlog.MultiOpen.Count)
{
window -t data MULTI;
fdlog.Get(A, ii);
open -w %A;
%B = %H;
window -r %B Sheet$(ii);
}
}
// Merge all worksheets into one dataset
fileCount = fdlog.MultiOpen.Count;
if (fileCount == 0)
{
type -b "Error: No files have been selected for loading.";
return; // exit the script
}
else if (fileCount > 10)
{
type -b "Error: Too many files selected. Maximum number is 10.";
return; // exit the script
}
else
{
// copy col D from sheet represented by count to the column
// represented by count in multiWks
window -t data MULTI;
%B = %H;
window -r %B multiWks;
loop (jj, 1, fileCount)
{
%(multiWks,jj) = Sheet$(jj)_D;
%J = Sheet$(jj)_J;
%K = "\L($(jj)) %J";
}
}