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
 LabTalk Forum
 Deleting the first row of every new value

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
jfriday09 Posted - 08/12/2019 : 4:30:15 PM
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System: Windows 7

Hello, and thank you in advance for any help you can offer. I'm new to origin, and only now looking into LabTalk.

I'm wanting to know if I am able to delete the first row of every new value in a column, and how I can do that.

For instance, in my case, my program gathers 5 rows of data per wavelength or detector position. I can't trust the first row of each new column value, so I want to delete the first row of each value in a given column.

Thanks again.
8   L A T E S T    R E P L I E S    (Newest First)
nick_n Posted - 08/20/2019 : 1:11:37 PM
Or
wreducerows method:=missing;
If you'd like to run labtalk.

Nikolay
nick_n Posted - 08/20/2019 : 1:03:46 PM
Hi,

First of all, remove all recalculation operation (Click on lock: Recalculate None).
Menu: WorkSheet\Reduce Rows\Method -> Delete rows with missing values
Regards,

Nikolay
jfriday09 Posted - 08/20/2019 : 10:27:40 AM
cpyang, thank you! My data would look like that, and you're right on the head with what I'm trying to do. I made a new column with the equations and they point out which are different. That definitely makes my life easier. There isn't a way to have Origin delete those rows for me though, is there?

Thank you so much, you are helping out a ton.

JF
cpyang Posted - 08/14/2019 : 2:50:15 PM
Are you saying that you have a column to identify the group, like this

123 4543.23
123 4534.12
123 4521.76
124 5432.12
124 5342.67
124 2432.67
124 4323.56

and you want to use delete the row when first column change right?

If that is the case, then you add a new column in your worksheet with formula, assuming col(A) is the grouping value
if(diff(A,2),0/0,1)

or
diff(A,2)?0/0:1


or if using labalk code, then you need to write out col(name) like
col(abc)=diff(col(A),2)?0/0:1


then you can delete rows with missing values.

CP
jfriday09 Posted - 08/14/2019 : 10:55:40 AM
Hey Yuki,

My program doesn't always produce 5 rows of data per new value in a column. Sometimes it will produce 4 rows, other times it will produce 6 rows. So I'm not able to safely assume I can delete every 6th row.

Sorry if I'm not making sense. Thanks again for taking the time to understand though.

Jacob
yuki_wu Posted - 08/13/2019 : 10:29:41 PM
Hi,

I think I may be not understand your question fully. Do you want to only delete the first row or delete the first row for every 5 rows?
wks.deleteRows(1) // Delete the first row in all columns
wdelrows del:=1 skip:=4 start:=1; //Start from the first row, then delete 1 row and skip 4 rows

Some info about wdelrows X-Function:
https://www.originlab.com/doc/X-Function/ref/wdelrows

Regards,
Yuki

OriginLab

jfriday09 Posted - 08/13/2019 : 7:13:45 PM
Hi Yuki!

Thanks for the pointer, it will definitely help. If my program doesn't necessarily generate 5 rows of data consistently, am I still able to delete the first row of a new value in a column? Is labtalk capable of recognizing a new value in a subsequent row in a given column? If not, I may have to make my program more consistent if I'm to use the wks.deleteRows(x, 1); function.

Thanks again. I'm sorry if I'm asking ill informed questions.
yuki_wu Posted - 08/12/2019 : 9:56:53 PM
Hi,

wks.deleteRows() method can help:
https://www.originlab.com/doc/LabTalk/guide/Basic-Worksheet-Column-Operation#Insert_or_Delete_Rows_in_Columns

Regards,
Yuki
Originlab

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