| Author |
Topic  |
|
|
LucSerre
Posts |
Posted - 02/01/2005 : 12:47:04 PM
|
Origin Version (Select Help-->About Origin): 6.1 Operating System:win2k
I have wks with about 60 Y cols. (ex: X y1 y2 y3 y4...y60) I'm trying (unsuccesfully) to add a blank column between all the y's. Ex: X y1 y1b y2 y2b y3 y3b...y60 y60b
Is there a command don't know about that I can use? Is there a simple way of doing this?
Thanks, Luc S |
|
|
Mike Buess
USA
3037 Posts |
Posted - 02/01/2005 : 1:16:15 PM
|
Hi Luc,
Starting with columns X Y1 Y2 the command "wo -i 2 Y1b" will create X Y1 Y1b Y2. If you're doing this in a loop keep in mind that inserting a column changes the numbering of all columns to the right. That will affect how you should structure the loop.
...In your case the following script should work.
for(ii=wks.ncols;ii>1;ii--) { wo -i ii Y$(ii-1)b; };
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 02/01/2005 1:24:59 PM |
 |
|
|
LucSerre
Posts |
Posted - 02/01/2005 : 1:35:14 PM
|
Thanks Mike! Great help!
That is the boost I needed to keep going with this project! Thanks again!
-Luc S |
 |
|
|
LucSerre
Posts |
Posted - 02/01/2005 : 2:03:47 PM
|
Ok, now I'm trying to do it a little diffrently and i'm getting confuzed.
Instead of renaming them to Yb1 format, I'm trying to rename the col to the string of the value of the cell right below the col title For example, I'm trying to rename col 4 to cell(1,4).
for(ii=wks.ncols;ii>1;ii--) { work -n $(ii) P$(cell(1,ii)); };
This works, except that it doesn't keep the sign of the cell. Ex, if cell(1,4)= -9.2, then it only make the title P9.2 and not P-9.2 |
 |
|
|
Mike Buess
USA
3037 Posts |
Posted - 02/01/2005 : 2:46:19 PM
|
The minus sign (along with most other special characters) is not allowed in a column name. Double-click on a column and try to name it P-9.2 yourself. Won't work.
Mike Buess Origin WebRing Member |
 |
|
|
LucSerre
Posts |
Posted - 02/01/2005 : 2:49:24 PM
|
WHen I use this code, right after the code that I just pasted my last message, it works.
for(ii=wks.ncols;ii>1;ii--) { wo -i $(ii) mes$(cell(1,ii)); };
This actualy puts the - in the col name. I don't know how that happened. |
 |
|
|
Mike Buess
USA
3037 Posts |
Posted - 02/01/2005 : 2:55:17 PM
|
Sounds like a bug and I would certainly avoid doing that. It will likely bite you when you need to use the column name in a LabTalk command.
Mike Buess Origin WebRing Member |
 |
|
|
LucSerre
Posts |
Posted - 02/01/2005 : 3:12:54 PM
|
Ok then, Thanks very much for the help.
 |
 |
|
| |
Topic  |
|