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
 All Forums
 Origin Forum
 Origin Forum
 reset column names

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
amorris Posted - 10/04/2005 : 1:01:46 PM
Origin Version (Select Help-->About Origin): 7.5
Operating System: winXP

Hi everyone,

I have a worksheet with about 10 columns. I'd like their names to be reset to the default "A,B,C,D...", however at the moment the names are all messed up like "A,D,E,G,B..." since I've inserted and deleted some columns. Is there any way to easily reset all the names (in labtalk or otherwise)?

Thanks,

Alexis
2   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 10/11/2005 : 11:54:22 AM
Hi Alexis,

The following script does the work beyond 26 columns, and gives the names like A, ... Z, AA, ... ZZ, AA1, AA2,...

%L=%H;
nn=wks.ncols;
window -t wks;
%M=%H;
for(ii=2;ii<nn;ii++) worksheet -c;
window -a %L;
for(ii=1;ii<=nn;ii++) {
%n=%(%M,@c,ii);
worksheet -n ii %n;
}
win -cd %M;


Mike Buess Posted - 10/04/2005 : 2:13:04 PM
Hi Alexis,

Don't think there's a built in way to rename columns but the following rather inelegant labtalk script will work if you have no more than 26 columns.

%Z=A B C D E F G H I J K L M N O P Q R S T U V W X Y Z;
loop (i,1,wks.ncols) {wks.col$(i).name$=$(i)}; // first rename as numbers to avoid conflicts
loop (i,1,wks.ncols) {wks.col$(i).name$=%[%Z,#i]}; // now rename alphabetically

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000