T O P I C R E V I E W |
EigenGoofy |
Posted - 07/13/2012 : 11:54:07 PM Origin Ver. and Service Release (Select Help-->About Origin): 8.5 Operating System: Windows 7
Hi, everybody!
Suppose that there is workbook with long name: 123456789123456789
Now, I want the workbook to have short name as the same as the long name.
Unfortunately, this can not be possible, OriginLab automatically cut my long name into the short name with only 13 digits remaining, such as A123456789123, which is not what I want.
Either of the following two solutions is wanted:
1. Since I made a LabTalk program, so how can I have the LabTalk program use or recognize the long name of the workbook, instead of the short name please?
2. How can I increase the allowed length or digits of the short name please?
Thank you very much! |
11 L A T E S T R E P L I E S (Newest First) |
Kathy_Wang |
Posted - 07/23/2012 : 05:22:30 AM Hi,
I'm not sure where your problem is, but at least I could get the script work with 8.5 in our local machines (both win 7 and XP):
To test your script, I suggest you start with a most simple case: 1. In a new empty project, change the workbook long name to "r100ke8temp30ns46run10", and keep the short name is "Book 1" as default.(right click on the title bar of the workbook, choose "properties" and change the long name there) 2. Renamed the "Sheet1" as "r100ke8temp30ns46run10" and fill in some test data in column 1 of it. 3. copy and paste the script to the script window( or command window) and run:
newbook name:= "r100AVEtrial" option:=lsname; // start a new workbook
range Acol = [r100ke8temp30ns46run10]r100ke8temp30ns46run10!col(1); //define a range from older workbook
col(1)=Acol; //copy data from older workbook to new workbook
A new workbook with name "r100AVEtrial" should be generated and the sample data in old workbook is copied into it.
You may refer to the following screenshot:
If this could work with your Origin and operation system, maybe then your "command error" has something to do with the workbook arrangements (e.g. the long names and short names of other workbooks), or it actually comes from some previous script; if this still doesn't work, then I'm afraid that I couldn't really explain the reason, and perhaps you should keep using the short names instead in the future.
Kathy Originlab |
EigenGoofy |
Posted - 07/23/2012 : 01:49:52 AM quote: Originally posted by Kathy_Wang
Hi,
I'm glad your problem is solved so far, but actually the "command error" comes from a wrong syntax of notes "\\". In Labtalk, it should be "//" .
I think you should find your script work when you change all "\\" to "//".
Kathy Originlab
Sorry, \\ is just typo posted here. Not in actual program.
The command error can be removed only if I shorten the filenames.
|
Kathy_Wang |
Posted - 07/22/2012 : 9:19:33 PM Hi,
I'm glad your problem is solved so far, but actually the "command error" comes from a wrong syntax of notes "\\". In Labtalk, it should be "//" .
I think you should find your script work when you change all "\\" to "//".
Kathy Originlab |
EigenGoofy |
Posted - 07/22/2012 : 2:43:43 PM Hi, Kathy!
Now I don't have the data on my hand, and can not test what I said. In general, I need to start a new workbook to collect data from 5 older workbooks.
newbook name:= "r***AVEtrial" option:=lsname; \\ start a new workbook
range Acol = [r***ke8temp30ns46run**]r***ke8temp30ns46run**!col(1); \\define a range from older workbook
col(1) = Acol; \\copy data from older workbook to new workbook
Since the name r***ke8temp30ns46run** is too long, so the shortname of any of the 5 older workbooks is not as same as its longname, so that the code range Acol = [r***ke8temp30ns46run**]r***ke8temp30ns46run**!col(1); does not work properly - command error!
However, my boss does not complain, and he have already used winshell to automatically shorten thousands filenames. So the problem is solved so far.
Thank you very much, Kathy!
Goodbye! |
Kathy_Wang |
Posted - 07/20/2012 : 01:59:32 AM Hi,
I am not sure if I understand correctly what you meant by saying "The problem is that the general workbook name "r***ke8temp30ns46run**" is too long to be used as shortname, which can be recognized by LabTalk."
Do you mean that you will need to do other worksheet manipulations in your script rather than define a range, do certain calculations with the ranges and copy the data? If so, please specify the manipulation you would like to do, and we will see what we can do.
As I said before, basically only the short name could be recognized in a Labtalk script. But if you only need to define a range with the long name of workbook, you could use the long names, an example is as following:
for(ii=200; ii<=205; ii++)
{
for(jj=10;jj<=15;jj++)
{
string str$ = r$(ii)ke8temp30ns46run$(jj);
range aa = [str$]1!1;
}
};
The temporary range aa is defined with workbook long name in a loop, which could be used for later calculation and copy-paste .etc
Kathy Originlab |
EigenGoofy |
Posted - 07/19/2012 : 10:19:36 PM quote: Hi,
If you only want to call a column in a workbook with the long name, it is possible,e.g. you could use the syntax:
[r259ke8temp30ns46run13]Sheet1!col(1) to indicate column A in Sheet 1 of workbook "r259ke8temp30ns46run13".
Please note that if you have duplicated long names in the project, you may not get your desired workbook.
Kathy Originlab
Hi, Kathy!
The general form of the workbook name is "r***ke8temp30ns46run**", in which "r259ke8temp30ns46run13" is just an example. The numbers can be changed for different filename. For example, "r259ke8temp30ns46run12", "r260ke8temp30ns46run13", etc. How to change name according to file is one of jobs which my program does, so I don't have to worry. The problem is that the general workbook name "r***ke8temp30ns46run**" is too long to be used as shortname, which can be recognized by LabTalk.
And since I need copy data from one workbook to another, so I need to use "range" function.
BTW, There is no duplicated long name.
Thank you,Kathy. |
Kathy_Wang |
Posted - 07/19/2012 : 8:50:22 PM quote: Originally posted by EigenGoofy
quote: Originally posted by greg
There should be no need for you to shorten any names. Please describe what you are trying to do where this is a problem.
Hello, Greg!
Each time I am trying to import 5 xvg files on 5 separate workbooks, and each of workbook has two columns A and B. The program will based on certain rules calculate the result and write it on a newly generated column C on each workbook. Then a whole new workbook will be created and collect the result on column C from each workbook, so that the new workbook will contain 5 columns corresponding to column C from each workbook.
The longname of each workbook is similar to "r259ke8temp30ns46run13", and the long name of the newly generated workbook is similar to "r259ke8temp30ns46AVE".
Thank you very much!
Hi,
If you only want to call a column in a workbook with the long name, it is possible,e.g. you could use the syntax:
[r259ke8temp30ns46run13]Sheet1!col(1) to indicate column A in Sheet 1 of workbook "r259ke8temp30ns46run13".
Please note that if you have duplicated long names in the project, you may not get your desired workbook.
Kathy Originlab |
EigenGoofy |
Posted - 07/19/2012 : 01:09:09 AM quote: Originally posted by greg
There should be no need for you to shorten any names. Please describe what you are trying to do where this is a problem.
Hello, Greg!
Each time I am trying to import 5 xvg files on 5 separate workbooks, and each of workbook has two columns A and B. The program will based on certain rules calculate the result and write it on a newly generated column C on each workbook. Then a whole new workbook will be created and collect the result on column C from each workbook, so that the new workbook will contain 5 columns corresponding to column C from each workbook.
The longname of each workbook is similar to "r259ke8temp30ns46run13", and the long name of the newly generated workbook is similar to "r259ke8temp30ns46AVE".
Thank you very much! |
greg |
Posted - 07/16/2012 : 11:52:32 AM There should be no need for you to shorten any names. Please describe what you are trying to do where this is a problem. |
EigenGoofy |
Posted - 07/16/2012 : 01:05:12 AM quote: Originally posted by Kathy_Wang
Hi,
The limit of digit length on short name cannot be changed. And you must use short name for programming.
Kathy Originlab
That is really a bad luck. There are thousands files out there waiting for me to shorten their names. Not a trival job!
However, thank you very much, Kathdy! |
Kathy_Wang |
Posted - 07/15/2012 : 11:24:31 PM Hi,
The limit of digit length on short name cannot be changed. And you must use short name for programming.
Kathy Originlab |
|
|