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
 Deleting every nth column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

zango24

India
Posts

Posted - 07/20/2006 :  08:03:03 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: Windows XP

Dear Friends,
I would like a help. I would like to select every nth column (for example every 3rd column) out of many column. Or if possible I would like to delete the every "group of columns". Means if I have many columns, I want to select 1st column and delete 2nd 3rd 4th column, then select 5th column, then again delete 6th 7th and 8th column then select 9th column and so on.

Help in terms of short script is very valuable.
Thanks in advance.

Mike Buess

USA
3037 Posts

Posted - 07/20/2006 :  09:32:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
1. This will select columns 1, 4, 7, etc.

wo -s -1 0 -1 0; // deselect all columns
for(i=1;i<=wks.ncols;i+=3) wks.colsel(i);


2. This will delete columns 2-4, 6-8, etc.

wo -d; // duplicate worksheet
for(i=1;i<=wks.ncols;i++) {
if( mod(i-1,4) ) wks.colsel(i);
};
menu -e 36442; // delete selected columns (execute Edit > Delete)
wo -s 0 0 0 0; // select all columns

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/20/2006 09:32:52 AM

Edited by - Mike Buess on 07/20/2006 10:05:12 AM
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