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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Row Filtering, Extracting interessting values

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ckrebs Posted - 06/09/2009 : 10:00:01 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8G SR1
Operating System:Win2000

Hi Forum,

i have a lot of measurment data. Sometimes there is a measurement error which writes a 0 in a row.
So i want to copy the rows consisting Valuea !=0 to a new row.
Is there a Documentation for BOOL Extract somewhre or a nice/fast implementation for this?

best regards,
3   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 03/30/2012 : 3:22:05 PM
To ___kfz___

The Table at the bottom of this page:
http://wiki.originlab.com/~originla/ltwiki/index.php?title=Category:LT_Running_Scripts
lists a number of ways to run scripts in Origin, but the most common is the Script Window or Command Window:
http://wiki.originlab.com/~originla/ltwiki/index.php?title=Script:From_Script_and_Command_Window
___kfz___ Posted - 03/30/2012 : 09:09:35 AM
quote:
Originally posted by Iris_Bai

We have a XFunction "wxt" to extract data from worksheet to new worksheet, or highlight result rows, or add a new column with 0/1 as mark, e.g.

//extract rows that not contain 0 in column 1 and column 2 to a new worksheet
wxt test:="col(1) != 0 AND col(2) != 0" ow:=<new>
Iris



Hello,
I have a similar task, I want to select rows for which the value in one column higher than "0" and in another column higher than "1". I guess, then script then will be like this, in analogy:

wxt test:="col(1) > 0 AND col(2) >1" ow:=<new>

My question is how to run this script, where to put this script?
Iris_Bai Posted - 06/10/2009 : 02:55:42 AM
Hi Christoph,

We have a XFunction "wxt" to extract data from worksheet to new worksheet, or highlight result rows, or add a new column with 0/1 as mark, e.g.

//extract rows that not contain 0 in column 1 and column 2 to a new worksheet
wxt test:="col(1) != 0 AND col(2) != 0" ow:=<new>

//highlight rows that not contain 0 in column 1 and column 2
wxt test:="col(1) != 0 AND col(2) != 0" sel:=1

// put on/off result to column 3 with condition values in column 1 and column 2 all are not 0
wxt test:="col(1) != 0 AND col(2) != 0" val:=3


Or you can use Origin C code. Please refer to following wiki page for detail examples on Worksheet::Extract function:
http://ocwiki.originlab.com/index.php?title=OriginC:Extract_Data_from_Worksheet

Look at strCondition, just change this variable to "col(1)!=0 && col(2)!=0" for your data.

Or use the following codes to generate condition to check value!=0 for all columns:

    string 	strCondition;
    foreach(Column col in wks.Columns)
    {
    	string str;
    	str.Format("col(%d) != 0", col.GetIndex()+1);
    	
    	if( strCondition.IsEmpty() )
    		strCondition = str;
    	else
    		strCondition += " && " + str;    	
    }



Iris

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000