| Author |
Topic  |
|
|
polphys
Germany
Posts |
Posted - 01/21/2005 : 09:19:49 AM
|
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 |
|
|
polphys
Germany
Posts |
Posted - 01/23/2005 : 4:49:41 PM
|
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. |
 |
|
|
Mike Buess
USA
3037 Posts |
Posted - 01/23/2005 : 9:25:56 PM
|
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 |
 |
|
|
polphys
Germany
Posts |
Posted - 01/25/2005 : 01:56:26 AM
|
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. |
 |
|
| |
Topic  |
|