The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Extracting Masked data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ravinder

India
8 Posts

Posted - 10/21/2004 :  1:43:54 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version 7 (Select Help-->About Origin):
Operating System: XP
Dear Friends,
I have a two-column (X,Y) data in origin worksheet. Some of the data is masked. I want to know if it is possible to write a Labtalk script that can extract the masked data and put in a new worksheet??
Regards,
Ravi

easwar

USA
1965 Posts

Posted - 10/21/2004 :  2:07:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Ravi,

If you look in LabTalk help files, you will find IsMasked() and FindMasks, which can be used to determin which rows/indices of a dataset are masked, and so that information can be then used to extract to a new sheet etc.

Easwar
OriginLab

Go to Top of Page

easwar

USA
1965 Posts

Posted - 10/21/2004 :  2:31:46 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Ravi,

The following is just a simple/crude script segment - modify/expand as needed - this looks at the 1st col of active worksheet, and then creates a new worksheet and copies over all masked rows of 1st col from source to new destiation sheet.

To execute, copy all lines and paste in script window, highlight all lines, and hit enter (click on source worksheet to make it the active window before doing this)

Easwar
OriginLab


// Get number of rows in current sheet
irows = wks.maxrows;
// Save name of current sheet in %a variable
%a=%h;
// Create a new sheet
win -t;
// Initialize counter
inum = 1;
// Loop over all rows of source sheet
for(ii=1; ii<=irows; ii++)
{
// If cell in 1st col is masked...
if( 1 == ismasked(ii, %(%a,1)) )
{
// Copy over to destiation
%(%h,1,inum) = %(%a,1,ii);
// Update counter
inum++;
}
}



Go to Top of Page

ravinder

India
8 Posts

Posted - 10/22/2004 :  12:52:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Eswar,
Thanks a lot. It works!!!
Regards,
Ravi
Go to Top of Page

greg

USA
1379 Posts

Posted - 11/12/2004 :  2:23:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There is a user interface for extracting data and there is a trivial way to know if a value is masked or not ...

Activate the worksheet with the dataset which has missing values.
Select Analysis : Extract Worksheet Data from the menu.
To get all the rows in the worksheet where values are masked in column A, enter this as the formula :
col(A)<i>==1
and click Do It.

The same way
col(A)[row]
can be used to read/write a worksheet cell, you can use
col(A)<row>
to read/write a cell's masked state.
1 = masked, 0 = not masked


Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000