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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Template <-> File Extension
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

buddyharle

Unspecified
1 Posts

Posted - 11/08/2002 :  02:43:07 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I would like to connect a certain file extension to a specific worksheet template. The problem is, that I have to import multiple ascii-files with different types a data. So what I have to do every time is to open the template, save it as origin.otw, import, open the next template, save it as origin ...

What I suggest is a connection with the use of file extension, say I have files called xyz.d1, cdf.d2, fge.d3. When I import .d1-files Origin should use template d1.otw and so on.

Any good ideas?

CU

Mike Buess

USA
3037 Posts

Posted - 11/08/2002 :  09:04:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi CU,

You can specify which template to use in the Import Multiple ASCII dialog. Check the "Import each file into a new worksheet" and a Template column will show up next to the File Name column. You can choose a different template for each data file if you want.

It's also straightforward to do what you want with LabTalk or Origin C scripts. Use fdlog.multiopen() to open the file selection dialog and fdlog.get(A,n) to assign the nth file to the string variable %A. Then you can use %[%A,>'.'] to find its extension and choose the template accordingly. Something like this...
fdlog.multiopen(); // count=number of files chosen 
loop (ii,1,count)
{
fdlog.get(A,ii); %T=Origin;
if("%[%A,>'.']"=="d1") %T=d1;
if("%[%A,>'.']"=="d2") %T=d2;
if("%[%A,>'.']"=="d3") %T=d3;
win -t D %T; // open template
open -w %A; // import file to template
};


That help?

Mike Buess
Origin WebRing Member
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000