Author |
Topic  |
|
YTian
1 Posts |
Posted - 11/09/2009 : 04:07:52 AM
|
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8 SR1 Operating System:Windows XP
Dear all, I have a huge amount of data points and some are "masked". Now I need to copy the unmasked data to Excel to do some calculations with VBA (I occasionally use Origin C but I am inclined to use VBA in this particular case because I am not familiar enough with Origin C to code complex program). So, how can I delete the "masked" points or only copy those "unmasked"? I know there is a tool in the Menu to delete data points: Data->Remove Bad Data Point. Unfortunately it seems that it can only delete points one by one. Does Origin have any good method to delete many data point sjust like the masking tool? I looked up in the program help and noticed there is a "IsMasked" command in LabTalk. I could not make it running as I have no idea about the programming with LabTalk. Any comments to this question is appreciated. regards with thanks YTian |
|
greg
USA
1379 Posts |
Posted - 11/09/2009 : 11:27:02 AM
|
The Worksheet menu in 8.1 has the Reduce Rows option which can be used to delete rows by multiple methods - including Delete rows with masked values. Like most X-Functions, you can save a Theme and make Delete rows with masked values part of your menu.
In version 8 you can use the Extract Worksheet Data tool to delete the rows where masked values are found or create a new worksheet with just the unmasked values using a number of steps.
Select Worksheet : Extract Worksheet Data...
To Delete: Select the column with Masked values (presumably your Y column) Click the => button to create an Alias (in this example : B) In the Condition text box, type B<i>!=0 Click Test -- select if true button (This causes only those rows with masked values to be selected.) Click the Close button Select Edit : Delete from the menu (NOT the Delete key) All rows with masked values are removed.
To Copy: Select the column with Masked values (presumably your Y column) Click the => button to create an Alias (in this example : B) In the Condition text box, type B<i>==0 Select 'Extract to New Workbook' as Output Click OK New Workbook will contain only those rows without masked values.
|
Edited by - greg on 11/10/2009 09:33:18 AM |
 |
|
AKazak
Russia
1205 Posts |
Posted - 07/05/2022 : 01:23:55 AM
|
OriginPro 2022b (64-bit) SR1 9.9.5.167 Windows 7 Pro SP1 x64
Greetings!
I have a variable number of masked cells in a worksheet:

How do I select and delete all the masked points (not rows) at once?
http://blog.originlab.com/extract-masked-points-to-a-new-workbook-automatically explains a way to select masked cells for two columns only by using isMasked(i,Y) in Worksheet: Worksheet Query…. However, it is unclear what to do if I have many columns.
--- Andrey |
 |
|
Echo_Chu
China
Posts |
Posted - 07/05/2022 : 02:14:52 AM
|
Hi, Andrey
Please work with labtalk to do what you need. For example, the scripts below are to delete the masked values from the first 4 columns.
for(ii=1; ii<=4; ii++) { wreducerows irng:=wcol($(ii)) method:=mask; }
Echo OriginLab Technical Service |
 |
|
AKazak
Russia
1205 Posts |
Posted - 07/05/2022 : 02:22:00 AM
|
quote: Originally posted by Echo_Chu
Hi, Andrey
Please work with labtalk to do what you need. For example, the scripts below are to delete the masked values from the first 4 columns.
for(ii=1; ii<=4; ii++) { wreducerows irng:=wcol($(ii)) method:=mask; }
Echo OriginLab Technical Service
Dear Echo,
The script removes rows, but I need to delete masked values only while keeping the original rows intact.
--- Andrey |
 |
|
snowli
USA
1426 Posts |
Posted - 07/06/2022 : 12:59:54 PM
|
Hi Andrey,
Highlight those columns and right click to choose Set Multiple Column Values...
Enter if(wcol(j)<i>!=1, wcol(j), --)
It will turn all those cells with mask with --.
It still shows them as masked but u can highlight all those columns and click Unmask Range toolbar button.
Thanks, Snow |
 |
|
AKazak
Russia
1205 Posts |
Posted - 07/06/2022 : 1:38:20 PM
|
quote: Originally posted by snowli
if(wcol(j)<i>!=1, wcol(j), --)
Thanks, Snow
Dear Snow,
What does this syntax mean? Where do I read more about this syntax?
--- Andrey |
 |
|
snowli
USA
1426 Posts |
|
AKazak
Russia
1205 Posts |
|
|
Topic  |
|