Hi,
You can run following LabTalk script to create a XYZI table suppose matrix books are naming as "Z0um", "Z2um", "Z4um",... etc:
doc -e M // Loop through all matrix books
{
matrix -ps X 0 200; // Set X range from 0 to 200
matrix -ps Y 0 200; // Set Y range from 0 to 200
@glob=1;
string strMat$ = page.longname$;
strMat$ = strMat.Between("Z","um")$; // Get Z Values from MatrixBook Long Name
int ZHeight = %(strMat$);
m2w method:=xyz; // Convert Matrix to XYZ
wks.addcol(ZHeight); // Add Z column
csetvalue col:=col(ZHeight) formula:="ZHeight"; // Set Value from Numeric Extracted from Matrix Long Name
}
@glob = 1;
string strPWKB$ = page.name$; // Let Current Workbook as Parent Workbook
string strPWKS$ = wks.name$; // Remember Current Worksheet for Appending Other Sheets
doc -e W // Loop through all Workbooks
{
string strTempWKB$ = page.name$; // Book Short Name of Current Workbook
if (strTempWKB$ != strPWKB$) // If not Parent Workbook, Start Appending
{
wAppend irng:=([%(strPWKB$)]1!, [%(strTempWKB$)]1!) method:=row ow:=[%(strPWKB$)]1!; // Appending
win -c %(strTempWKB$); // Delete Appended Worksheets
}
else
continue;
}
dataset sps = {4,1};
dataset sodr = {1,1};
wsort nestcols:=sps order:=sodr; // Sort Appened Worksheets by Z (Height)
colmove rng:=col(4) operation:=left; // Move Z column to be 3rd Column
wks.col1.lname$="X";
wks.col2.lname$="Y";
wks.col3.lname$="Z";
wks.col4.lname$="Intensity";
page.longname$= "XYZI Table";
page.title=1; // Naming
Regards!
Sean
OriginLab Tech. Service