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
 Origin Forum
 How to automatically open a xy data file into a graph by clicking on it?

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
Calico Posted - 08/20/1998 : 12:19:00 PM
In an earlier post I asked how to open a xy data file by clicking on it without
having to first enter Origin (ie Origin automatically starts and loads it).
The instructions provided worked well and I thank the person who responded.
Since then I have tried to modify the commands such that instead of the data
being loaded into a worksheet, it loads into a graph, the first column
corresponding to X, and the remaining columns being y. I haven't been able to
do this, but is it possible?
1   L A T E S T    R E P L I E S    (Newest First)
Gary Lane Posted - 08/20/1998 : 12:21:00 PM
Launch Origin and plot data by double-clicking on a *.DAT file

I'm happy that my earlier solution worked for you...here is an updated version
which also plots the imported data!

It is possible to launch Origin by double-clicking on a *.DAT file
(an ASCII data file), have Origin automatically import the .DAT file
and then plot all the columns into a graph window. In order to do
this you will need to complete the following three steps:

1. In your Windows Explorer select View ptions, Click on the File
Types tab, select the file extension DAT, click the Edit button, select
open in the Actions list box, click the Edit button, enter
C:\Origin50\OpenDat.bat in the Application used to perform action
edit box, click OK and Close until you return to the Windows
Explorer.

2. Create the file OpenDat.bat in your C:\Origin50 folder and type in
the following DOS batch commands:

@echo off
echo opendat=1; %%A=%1 > C:\Origin50\OpenDat.cnf
start C:\Origin50\Origin50.exe -a OpenDat.cnf -tw OpenDat.otw
exit

3. Open Origin, click on the New Worksheet button, and set your
ASCII import Options as desired (select File:Import:ASCII Options).
Click on the Text Tool on the Tools toolbar and then click once in the
white area of the new worksheet. Enter OpenDat where it says enter
text here in the Text Control dialog box and click OK. Right click on
the new text object and select Label Control. In the Label Control
dialog box enter OpenDat in the Object Name edit box, select Window
Create from the Script, Run After list box, uncheck the Visible check
box, and enter the following script in the large edit box:

If (opendat==1) { // execute script once
open -w %A; // import ASCII file
queue { // delay execution untill window is
ready
worksheet -s 0 0 0 0; // select all columns
worksheet -p 200 line; // plot selected columns
legend; // add/update legend
};
opendat=0; // don't execute script again

Finally, click OK to close the Label Control dialog box and save the
worksheet as the worksheet template OpenDat.otw in your main
Origin folder (select File:Save Template As).

After completing the above steps, when you double-click on a *.DAT
file Windows will launch OpenDat.bat which will launch Origin which will
import the DAT file that was double-clicked on and then plot all of the
columns
in the worksheet into a graph window.


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