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
 Trimming excess columns from a worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

gaba

USA
3 Posts

Posted - 09/29/2002 :  4:09:30 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi

I have been importing electrophysiology data into Origin 6.1 using the Bruxton Data Access 6.1 add on software. I often end up with a few extra columns at the end of my worksheets, and I was wondering if there was a simple way to detect empty columns and delete them using labtalk?

Thanks
Mark Fry

Mike Buess

USA
3037 Posts

Posted - 09/29/2002 :  8:08:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mark,

Here's one way. It checks each column starting with the last and deletes it if it contains no data points.

for(ii=wks.ncols;ii>0;ii--) {
sum(wcol(ii)); // apply the sum() function to column #ii
if(sum.n>0) break; // exit the loop if the column contains any data points
del wcol(ii); // delete the column if not
};

Mike Buess
Origin WebRing Member
Go to Top of Page

gaba

USA
3 Posts

Posted - 09/30/2002 :  10:05:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That's perfect!

Thanks
Mark Fry
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