Author |
Topic |
|
amorris
Canada
Posts |
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
|
|
Mike Buess
USA
3037 Posts |
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 |
|
|
Hideo Fujii
USA
1582 Posts |
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;
|
|
|
|
Topic |
|
|
|