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
|
|
|