Evaluating filenames in a Windows directory

Alexander
Member Posts: 2
Please can so. help me with this request?
I want to import text files into Navision 2.60.
It should be determined by the initial letters of the filename which out of three dataports should be applied to read in the text file.
Does anyone know of a module which can open a Windows directory and read the filenames of all files enclosed in this directory, so it is possible for Navision to derivate the right dataport to be run with the filename?
Another question would be if this is also possible automatically. Can it be automatically detected when another text file to be imported has been added to the directory?
Thank you.
I want to import text files into Navision 2.60.
It should be determined by the initial letters of the filename which out of three dataports should be applied to read in the text file.
Does anyone know of a module which can open a Windows directory and read the filenames of all files enclosed in this directory, so it is possible for Navision to derivate the right dataport to be run with the filename?
Another question would be if this is also possible automatically. Can it be automatically detected when another text file to be imported has been added to the directory?
Thank you.
0
Comments
-
There are two virtual tables, 2000000020 and 2000000022, which you can declare as a variable. The allow you to read the entire contents of the hard drive. You can use them as you would with any other table.
Experiment with them. You'll soon find what you need
Dennis Decoene
Navision Software Engineer
http://www.microcomputing.be0 -
Just remember that when You create Your "dispatcher", You'll have to redirect Your pointer in the File Table and set the filter again each time You search for any new files. If You don't do this You won't find any new files.
Example:
File.SETRANGE("Is a file",TRUE);
REPEAT
--File.SETRANGE(Path,'c:\');
--IF File.FIND('-') THEN BEGIN END;
--File.SETRANGE(Path,'c:\where You want to look for files');
--IF File.FIND('-') THEN
----REPEAT
//Your code that does something with each file
----UNTIL File.NEXT = 0;
UNTIL You're finished and want to go home
//Lars Westman
[This message has been edited by laweume (edited 24-04-2001).]Lars Westman
http://www.linkedin.com/in/larswestman0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions