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
 Reading the file name?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

autopilot

26 Posts

Posted - 03/18/2009 :  08:43:53 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 7.5 SR6
Operating System: WinXPPro

Hello,

In order to import the data from files, I need to know the file names in advance. But what if I do not know the files name?
Is there any command to read the file names?

rlewis

Canada
253 Posts

Posted - 03/20/2009 :  03:20:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The following is an example of a LT script that can be used to browse for a file ... before acting upon it

run.section(file.ogs,Init);
FDLOG.numTypes=1;
FDLOG.type1$=[User Data *.*]*.*;
FDLOG.Dlgname$=Select one or more User Data Files;
if (FDLOG.multiopen()==0/0) return 1;
MyCounts=FDLOG.multiopen.count;
for (k=1;k<=MyCounts;k+=1)
{
	Fdlog.get(A,k); // %A now contains the path to the first data file
	// do something with %A 	
};

Go to Top of Page

autopilot

26 Posts

Posted - 03/23/2009 :  4:56:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much for the reply,

however, this script uses the open dialog window, but I need to automatically load all available files without dialog...

Cheers
Go to Top of Page

rlewis

Canada
253 Posts

Posted - 03/23/2009 :  6:27:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
May be a bit tricky with LabTalk ...
However, if willing to try OriginC there are functions like
FindFile, FindFiles, FindFirstFile, FindNextFile, GetFileNames, GetFilenamesInFolder, etc which will do what you want.
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