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 for Programming
 LabTalk Forum
 directory for multiple ASCII import
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

polphys

Germany
Posts

Posted - 01/21/2005 :  09:19:49 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): v7.0552
Operating System:win2000

Hi,

I want to define the path for a multiple ASCII import (getfilename -m) in my LabTalk script, but I didn't find a n appropriate command. Or is there any solution to import all files with a given extension of a known directory without using getfilename -m?

Mike Buess

USA
3037 Posts

Posted - 01/21/2005 :  10:02:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can learn about a LabTalk method for importing all files in a given directory here...

http://www.nmrtools.com/labtalk/i_flist.html

An Origin C method for doing the same thing is discussed in this topic...

http://www.originlab.com/forum/topic.asp?topic_id=2952&archive=

Mike Buess
Origin WebRing Member
Go to Top of Page

polphys

Germany
Posts

Posted - 01/23/2005 :  4:49:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you Mike for your help,
with these ideas I could import all files. But for a selection of files, I prefer getfilename -m. But fdlog.path$ seems to define only the path for the dirctory of an open command. And I want to start in a special directory, because it is already known at this time.

Thanks again for solving the import of all files.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 01/23/2005 :  9:25:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Both solutions import files with a specific extension. The LabTalk solution requires you to select one file in a folder and then imports all files in that folder with the same extension. The Origin C solution imports all files in a named folder that have the extension "txt". LabTalk has no method for listing files so the first solution uses a batch program to obtain that list. The second solution may be best suited for your situation. Just specify your starting directory in strPath and substitute your extension for "txt".

...Are you really just looking for a way to open the multiple file dialog in a specific folder? If so, use fdlog.path$ to name the folder and fdlog.multiopen() to open the dialog. Then use fdlog.get(A,n) to assign the nth selection to the string variable %A.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 01/24/2005 07:18:24 AM
Go to Top of Page

polphys

Germany
Posts

Posted - 01/25/2005 :  01:56:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you,
it's really so easy. I didn't see the wood for the trees and afterwards, I cannot understand, why I didn't find it by myself (overly fixed to the getfile -m command).
The fdlog.multiopen command has the wanted flexibility. So I can offer the choice between the import of all files completely automatically by running appropriate DOS commands in a batch file with the run -e command (as shown in the first answer) or an individual selection of files, starting in a given directory.

Thank you again.
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