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
 Batch Processes in Origin 5.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
whysker Posted - 11/23/2001 : 6:21:13 PM
I am using Origin 5.0 and want to program a simple batch process in the script language to avoid loeading, converting and saving 500 files ...
So I wrote the following short script:

worksheet -e ASCII;
getfile -m *.cv;
p=1;
for( ;pgetfile -g p;
open -w %A;
worksheet -s A 0 B 0;
worksheet -p 200 Graph1;
save -bs Graph1 %A 400 300 [B];
window -c Graph1;
p++;
};

What it should do is ... loeading the file into the worksheet - generating the according graph of the selected columns - save a bmp-File of this graph to the same directory - close the graph - load the next file .... and so on!

Apparently I get the two following error messages that are messing up the whole thing:

Executing the line: open -w %A;
the following error message pops up: Error:draw -n header -r

Executing the line: save -bs Graph1 %A 400 300 [B];
the following error message pops up: Error:save -bs Graph1 %A 400 300 [B]

Then the for loop also stops ... the window doesn't close etc.

Does anyone know what I am doing wrong?! How do you program such a simple batch process (load, save) ... with a bitmap output (or .wmf-File).

Any hint is welcome.

Thonks,

Tom.
2   L A T E S T    R E P L I E S    (Newest First)
rtoomey Posted - 11/27/2001 : 10:51:06 AM
I also wanted to mention that there's a Tech Review directly related to this type of scripting. It is called Batch Processing Files in Origin. It is located at:

http://www.originlab.com/www/resources/tech_reviews/june2000/page1.asp

- rtoomey

rtoomey Posted - 11/26/2001 : 2:29:33 PM
The script you supplied has a few problems. Below is a description of each.

  1. The for loop is not quite right. The easiest thing to do would be to utilize the "count" variable which gets set in the getfile -m command.

  2. You try to use the worksheet -s command option with column names. This command accepts only numbers. To get the column number associated with a particular column name, use the colnum() function. To express the value of the colnum() function in a command, enclose it in $().

  3. The save -bs command has the [B] option in it. This option should be entered as simply B, not [B]. The square brackets are used in our documentation to indicate that the setting is optional. They aren't actually part of the command.

  4. The save -bs command creates a command error no matter what you do. This is a bug which was addressed in Origin 6.1. To avoid this bug in earlier versions, place the save -bs command in a separate section in an OGS file.
I have modified your script to take all these things into account. Copy the script below from // begin script to // end script and save it as "Script.OGS" in your Origin 5.0 installation folder.


// begin script

[main]

worksheet -e ASCII;
getfile -m *.cv;
for(ii=1;ii<=count;ii++)
{
getfile -g ii;
open -w %A;
%B=%H;
worksheet -s $(colnum(B)) 0 $(column(B)) 0;
worksheet -p 200;
run.section(,savebmp);
window -c %H;
win -a %B;
}

[savebmp]

save -bs %H file$(ii).bmp 400 300 B;

// end script



Then, in the script window, execute the following:

run.section(script,main);

Note: The name "script" can be replaced if you prefer. Just make sure you replace it in both places (i.e. in the run.section and when saving the file to your Origin 5.0 insatllation folder).

If this does not work, please let me know.

-rtoomey





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