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 for Programming
 LabTalk Forum
 get row index
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

VanAwful

USA
13 Posts

Posted - 08/23/2019 :  10:00:24 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2019b (64-bit)
9.6.5.169

Hello, I need to look through 500k rows. I am looking at ColF value. When I get to a row that is not equal to 0 then I need to get the time from ColA in that row. Next, I need to increment through the following rows until the value again is 0. I get the time value from the last row that a value greater than zero. I now calculate the delta between the first time stamp to the last time stamp and store that in a different worksheet. Then I continue on until again the value becomes not equal to 0.

To do this I need to acquire the row index. I am not finding a way to do this. Anyone know how to do this?

Example of my data. I need to calculate the time delta from when the value in ColF is no longer zero to when it is zero again. I need to do this in the F(x)= cell of ColF.

ColA (time)    ColB     ColC    ColD    ColE           ColF
-9.37724E-01	0	0.9	0.8	1.1		0			
-9.37722E-01	0	0.7	0.8	0.9		0			
-9.3772E-01	0	0.9	1.6	0.7		0			
-9.37718E-01	0	0.9	0.8	0.9		0			
-9.37716E-01	0	0.7	0.8	0.9		0			
-9.37714E-01	19.2	0.9	-0.8	0.9		0			
-9.37712E-01	21.6	0.7	0	0.9		1	
-9.3771E-01	22.4	0.7	0.8	0.9		1			
-9.37708E-01	21.6	0.7	0.8	1.1		1			
-9.37706E-01	21.6	0.9	0.8	1.1		1			
-9.37704E-01	21.6	0.7	0	0.9		1		
-9.37702E-01	21.6	0.7	0.8	0.7		1			
-9.377E-01	23.2	0.7	0.8	0.9		1		
-9.37698E-01	22.4	0.7	0.8	0.9		1			
-9.37696E-01	22.4	0.7	0	0.9		1			
-9.37694E-01	22.4	0.9	0.8	0.9		1			
-9.37692E-01	23.2	0.7	1.6	0.7		1			
-9.3769E-01	22.4	0.9	0.8	0.9		1			
-9.37688E-01	22.4	0.7	0.8	0.7		1			
-9.37686E-01	22.4	0.7	0.8	0.9		1			
-9.37684E-01	22.4	0.7	0.8	0.9		1			
-9.37682E-01	23.2	0.7	0.8	0.7		1			
-9.3768E-01	23.2	0.9	0	0.9		1			
-9.37678E-01	22.4	0.9	0.8	0.9		0			
-9.37676E-01	23.2	0.9	0.8	0.9		0			

yuki_wu

896 Posts

Posted - 08/26/2019 :  01:56:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can perform diff function on col(F). If result = -1, it means that the value is from 1 to 0; if result = 1, it means that the value is from 0 to 1.
https://www.originlab.com/doc/LabTalk/ref/Diff-func

Then you can use table function to locate the result value that equals to 1 or -1.
https://www.originlab.com/doc/LabTalk/ref/Table-func

Regards,
Yuki
OriginLab
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