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
 Turn 1 project into many

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
DDrennan Posted - 03/03/2016 : 1:33:35 PM
I have a chemist who likes to create 1 project with data from multiple sources. We need a way to script, preferably in LabTalk, a way to save each graph into its own project. I tried this but I only get 1 graph with the name "newName.ogg".

{ // section brackets for error handling
doc -e L
{ // loop over layers
string LayerName$ = %H;
if (find(LayerName$, "Graph")>0) {
save -i %H;
}
}
}
doc -s;
exit;

DDrennan
4   L A T E S T    R E P L I E S    (Newest First)
DDrennan Posted - 03/03/2016 : 3:55:29 PM
oops, never mind. I was running an older version...
(blush)
Thanks for your help !

DDrennan
Hideo Fujii Posted - 03/03/2016 : 3:42:58 PM
Hi DDrennan,

Your/my code will never produce "newName.ogg" because you filtered out such name by the condoition, "find(LayerName$, "Graph")>0" - therefore you should get only files like Graph1.ogg, Graph2.ogg, etc. You can try a debug command before save command like:
type -a %Y%H;

--Hideo Fujii
OriginLab
DDrennan Posted - 03/03/2016 : 3:11:56 PM
Hi Hideo,
I tried that, and I'm still getting only one output file, called newName.ogg -- a name which doesn't appear anywhere in my project. It only has one graph in it, so it's at least getting that part right - but I want a separate file for each graph in the project.
Di


DDrennan
Hideo Fujii Posted - 03/03/2016 : 2:25:04 PM
Hi DDrennan,

If you want to loop over every graph, you need to use "P" option in Doc -e command, insread of "L" option (which scans every layer in a single graph). E.g.:
doc -e P { // loop over graphs
  string GraphName$ = %H;
  if (find(GraphName$, "Graph")>0) {
    save -i %Y%H; //Save graph in the User Files Folder
  }
}

Hope I didn't misunderstand what you intended.

--Hideo Fujii
OriginLab

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