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
 looping over hidden datasets

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
gfitzgerald Posted - 07/24/2014 : 4:20:04 PM
Hello, All,
I am using Origin 9.0.0 b45
I am trying to loop over all datasets in a project and export them as ascii using LabTalk. When I execute a loop like
doc -e W {type %H}
it shows me 2 workbooks. But I can see 3 graphs. The plot properties show me a graph, with a layer, and 3 plots. Data hierarchy is something like this:
Graph1
- Layer1
-- T1
-- [T2]Sheet1!A(X)B(Y)(1*200)
-- [Book1]Sheet1!(A(X)B(Y)(1*800)

Does this mean that the dataset T1 somehow exists in the graph without being in a workbook? How can I access and export this data?

thanks,
George

2   L A T E S T    R E P L I E S    (Newest First)
gfitzgerald Posted - 07/25/2014 : 12:47:41 PM
That is awesome. I found I can even use this for the non-loose datasets using doc -e DY so I can use the same code to handle all of them.

Thanks a bunch.

gxf
jasonzhao Posted - 07/24/2014 : 11:43:03 PM
Hi George,

T1 is a loose dataset in Graph1, You can get the data in T1 by using LabTalk Script below:

string strY$ = T1;  // Name of the loose dataset Y
range dsY = [??]!%(strY$);  // Range to the loose dataset Y
%a = xof(dsY);  // Get the name of loose dataset X
string strX$ = %a;  // Put to a string variable
range dsX = [??]!%(strX$);  // Range to the loose dataset X

newbook result:=tmpbook;  // Create a temp book for loose dataset
range rx = [%(tmpbook$)]1!1;  // 1st column of the book
range ry = [%(tmpbook$)]1!2;  // 2nd column of the book
rx = dsX;  // Put loose dataset X to column 1
ry = dsY;  // Put loose dataset Y to column 2
expASC iw:=[%(tmpbook$)]1! path:="d:\aa.dat";  // Export ascii
win -c %(tmpbook$);  // Delete the temp book


Best regards,
Jason Zhao
OriginLab Tech Service

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