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 for Programming
 LabTalk Forum
 file name in origin8.0

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
circumvent 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
5   L A T E S T    R E P L I E S    (Newest First)
circumvent Posted - 02/03/2009 : 4:27:14 PM
impasc fname:="%A" works.

Thank you very much, cpyang.


Jinbo
cpyang 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 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
snowli 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.
snowli Posted - 01/27/2009 : 4:14:26 PM
Hi Jinbo,
In Origin 8, we have xfunction impASC to import files and it has more controls than open command. E.g. it can decide if you want to rename book/sheet name or not, remove leading zeros from numbers or not, etc. You can look at the following wiki to see how it works.
http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Accessing_Worksheet_Data%2C_Metadata_%28Labels%29_and_Legend#Open_an_ASCII_File_to_Worksheet_and_convert_to_Matrix

E.g. I changed your script as follows,
getfile -m *.*;
loop (ii,1,count)
{
fdlog.Get(A,ii);
impasc fname:=%A;} //I only changed this line


Thanks, Snow Li
OriginLab Corp.

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