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 values from dataset (not worksheet)

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
iggboert Posted - 11/17/2009 : 07:51:44 AM
Origin Ver. 8 and Service Release SR4:
Operating System: WinXP

Hello,

to delete some selected data of a worksheet i used this:

wxt "col(4)[i]<0.001" sel:=1; 
menu -e 36442; 


but now i want to make the code more efficient because i have tons of data.
Now i'm using datasets to calculate and for analysis. i wanted to use the following code to erase the nonnecessary data. But it doesnt work on a dataset, only on a worksheet. Any suggestions?


dataset temp1 = {1,2,3,4,5,6,7,8,9,0};
for(i=10,i=0,i--)
{
    if(temp1[i]<=5||temp1[i]>=3)
    {
    mark -d temp1 -b i -e i;
    // tried also "mark -d temp1[i]"
    };
};


Regards
Christoph
2   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 03/22/2010 : 5:06:06 PM
We have added the RemoveAt method to remove elements of a loose dataset based on index. You can now use:

dataset temp1 = {1,2,3,4,5,6,7,8,9,0};
temp1.removeat(9); // Removes '9'
temp1.removeat(7); // Removes '7'
temp1.removeat(5); // Removes '5'
temp1.removeat(3); // Removes '3'
temp1.removeat(1); // Removes '1'
col(1)=temp1; // Now equals (2,4,6,8,0}

dataset temp1 = {1,2,3,4,5,6,7,8,9,0};
temp1.removeat(1); // Removes '1'
temp1.removeat(3); // Removes '4'
temp1.removeat(5); // Removes '7'
temp1.removeat(7); // Removes '0'
temp1.removeat(9); // Does nothing - index out of bounds
col(2)=temp1; // Now equals {2,3,5,6,8,9}
easwar Posted - 11/19/2009 : 09:28:46 AM
Hi Christoph,

Sorry for the late response, we do not have a method in LT to delete elements in a temp dataset, thanks for the suggestion, we will add this in a future service release/version.

For now methods exist in Origin C for deleting elements of a vector etc, so you may want to consider using Origin C

Easwar
OriginLab

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