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
 Origin Forum
 How to delete invalid data in batch?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Younger2008

USA
Posts

Posted - 03/05/2006 :  12:58:12 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: 2000

I got datasheet with several columns sorted as XYXYXY...
but for some cases the X value exist while Y value doesn't exist instead of a dash symbol (-) in worksheet, if I use line+symbol style to plot data, the line to connect the symbols is not continuous because the invalid data I mentioned are also plotted.
So how to delete the invalid data (both X and Y) in batch?

Thanks
Younger

Mike Buess

USA
3037 Posts

Posted - 03/05/2006 :  2:46:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Younger,

page.connect=1 will connect the points on both sides of the missing value(s).

Mike Buess
Origin WebRing Member
Go to Top of Page

Younger2008

USA
Posts

Posted - 03/06/2006 :  06:40:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, Mike!
It really does work.
But is there a command to remove dash(-) in worksheet? This will make the worksheet look nice.

Regards,
Younger

Edited by - Younger2008 on 03/06/2006 06:41:41 AM
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 03/06/2006 :  08:49:19 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Younger, try this while your XYXYXY... worksheet is active.

sort.wksname$=%H;
sort.missing=1; // treat missing values as largest
for(ii=1;ii<wks.ncols;ii+=2) {
%A=wks.col$(ii).name$;
%B=wks.col$(ii+1).name$;
get col(%A) -e nrow; // # of rows
sum(col(%B));
nval=sum.n; // # of (non-missing) values
sort.c1=ii;
sort.c2=ii+1;
sort.r1=1;
sort.r2=nrow;
sort.cname1$=A: %B;
sort.wks(); // move missing values to bottom
sort.r2=nval;
sort.cname1$=A: %A;
sort.wks(); // restore order of non-missing values
wo -s ii nval+1 ii+1 nrow; // select missing values and their Xs
menu -e 36442; // execute Edit > Delete
};

Mike Buess
Origin WebRing Member
Go to Top of Page

Younger2008

USA
Posts

Posted - 03/06/2006 :  10:56:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I copy the code to script window and cannot execute them. What's the problem?

Sorry I have no experience on programming in Origin.
Go to Top of Page

Younger2008

USA
Posts

Posted - 03/06/2006 :  11:14:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It works. I save the code into a Custom.ogs file and it's ok!
Many thanks!!!
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 03/06/2006 :  11:43:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
FYI, select all lines and press Enter to execute from the script window.

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