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
 How to remove blank column(s) on 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

hkkim

Republic of Korea
35 Posts

Posted - 02/13/2013 :  03:58:07 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.1 SR3
Operating System: Windows XP

Hello!

I am looking for a way to delete trailing blank column(s) in worksheet after importing data. Is there any LabTalk command or X-function for it? An ordinal number of a blank column is variable. Is it can be solved by declaring "System.wks.transpDelEmptyCols=0;" before importing? But my test was failed.

Thanks.

hkki

cpyang

USA
1406 Posts

Posted - 02/14/2013 :  5:25:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
How about deleting all but one column in the worksheet before import?

Not sure if 8.1 support wks.nCols=1.

CP
Go to Top of Page

hkkim

Republic of Korea
35 Posts

Posted - 02/15/2013 :  02:34:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks cpyang!

I tested as your comment but it did not work. I want to know the way to delete empty last column after importing. Thanks again!

hkkim
Go to Top of Page

minimax

348 Posts

Posted - 12/10/2015 :  05:53:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi hkki,

How about following scripts.
ncols=wks.ncols;
for(ii=ncols;ii>=1;ii--)
{
	if (wks.col$(ii).nrows==0)
	{
		del col($(ii));
	}
	else break;
}
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