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
 deleting rows in specific datasets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

blt2si

Germany
37 Posts

Posted - 04/14/2003 :  09:33:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello All,

A very basic one I'm sure!
I used the intermediate string but now want to delete data out of the dataset before I copy it across. (see "Using $,% notation" question)
- Copy datasets from one worksheet to another.
- Delete the first 9 rows of the specific dataset only.
- Copy the remaining to the end of the another dataset.

This is the coding:
loop (ii,1,8)
{
%T=Interface!Filename.V$(ii)$;
%I=SS$(ii);
copy -x %T_ZW %A_%I;
mark -d %I -b 1 -e 9;
copy -a %A_%I %A_ZWalle;
};

However, using "mark -d" deletes rows 1 to 9 on every dataset in the worksheet. Do I need to specify the range of data that is to be deleted more clearly?

Thanks

Mike Buess

USA
3037 Posts

Posted - 04/14/2003 :  10:28:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Blank,

I'm afraid the mark command always deletes the entire row. However, you can use the copy command to move rows 10 through last to the beginning of the column. If col %I originally has rr rows you could use something like this...

rr2 = rr-9;
tmp = data(1,rr2); // create temporary dataset
copy -b 10 %A_%I tmp -b 1 -e rr2; // fill it with desired values
set %A_%I -e rr2; // truncate %A_%I
copy tmp %A_%I; // copy tmp to %A_%I
del tmp; // clean up

Mike Buess
Origin WebRing Member
Go to Top of Page

blt2si

Germany
37 Posts

Posted - 04/15/2003 :  09:50:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
With the data that that is analysed the number of rows often varies (from 11 < rr < 120).
How do you get the "end row number" in Labtalk?
In Origin C language it is simply "wks.GetNumRows" command
With Labtalk i look at possibly using:

get name option [variableName]
-e [variableName]
Get the end of the display range (the value of variableName equals the last index number)

So if "%R" was the end row (rr) and "%A_%I" was the dataset then:

get %R -e %A_%I;

But this does not work!
Do you have any suggestions?
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 04/15/2003 :  5:23:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The "name" in the command description refers to the dataset name. In your case the command should be written like this

get %A_%I -e rr; // rr is the last row displayed
rr=;
RR=120



Mike Buess
Origin WebRing Member
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