Author |
Topic  |
|
circumvent
Posts |
Posted - 01/26/2009 : 8:35:05 PM
|
Origin Ver. and Service Release (Select Help-->About Origin): Operating System: Vista
Hi, I got a problem when updating origin from 7.5 to 8.0
In origin7.5, getfile -m *.*; loop (ii,1,count) { fdlog.Get(A,ii); open -w %A;}
if I import one file, T1234, The current worksheet will have the name T1234, good for my next analysis. %H=T1234
In origin8.0, it will have a book called book1, then a worksheet named T1234. The problem is, I can not get the information "T1234" through %H now. Does anyone know how to solve the problem, either using different getfile name, or the worksheet has special system name?
Thanks
Jinbo |
|
snowli
USA
1437 Posts |
|
snowli
USA
1437 Posts |
Posted - 01/28/2009 : 09:47:33 AM
|
Hi Jinbo,
In 7.5, there is only one sheet in a worksheet window. So usually you can use it's useful to get %H for future analysis.
In 8.0, we support multiple sheets in each workbook, so it may not be necessary to get %H and use it for future analysis. We use range notation to specify Origin objects. E.g. [WindowName]LayerName_or_Index!DataRange, where WindowName can be workbooks, matrix books, graph windows; LayerName_or_Index can be worksheets, matrix sheets, graph layers; and DataRange is the data. For workbook windows when declaring range variable on the active worksheet, the book and sheet part can be dropped.
E.g. range ra=2; //specify ra to be the second column of active sheet in workbook range rb=[book1]1!3; //specify rb to be the 3rd column on first sheet of book1 window, etc.
You can look at the following wiki page for more details of range notation http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Range_Notation
Thanks, Snow Li OriginLab Corp. |
 |
|
circumvent
Posts |
Posted - 02/01/2009 : 4:49:21 PM
|
Hi Snowli,
Thanks for your help.
By the way, did you actually try the command "impasc fname:=%A" in your computer? In my case, it give error message "#Command Error"
later I only used "impasc", a dialog did open and ask me to select file and import it. Then the following information showed up
impASC.orng = [data]data!A //related to my file name File1.Header = File1.SubHeader = File1.DataRange = Sheet1!A[1]:B[54] //related to my file range
I check "%A=", it will give the file name "%A=C:\whatever\data.txt" but "impasc fname:=%A;" will give only command error.
I suspect that it might related to the updates. SO I check "Click for updates", origin will tell me that I can only run updates as an administrator. (in Vista) But I already logged in as an administrator.
Jinbo |
Edited by - circumvent on 02/01/2009 4:50:18 PM |
 |
|
cpyang
USA
1406 Posts |
Posted - 02/01/2009 : 10:55:21 PM
|
better way to use impasc is to use the default file name variable fname, as below:
fname$=%A;
impasc;
Not sure why impasc fname:=%A; would not work, but maybe should really be written as
impasc fname:="%A";
as %A might contain spaces. You may check this page to see more examples:
http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Data_Import
CP
|
 |
|
circumvent
Posts |
Posted - 02/03/2009 : 4:27:14 PM
|
impasc fname:="%A" works.
Thank you very much, cpyang.
Jinbo |
 |
|
|
Topic  |
|
|
|