Directory / Several files in a directory

miabuso
Member Posts: 4
I want to work with several files in the same directory.
I use a expression like "c:\*.txt", then open all files with "txt" in directory "c:\", and make a process with all files (one by one).
¿Do it exists any way to do that in NAV 5.0?
Thank you very much.
I use a expression like "c:\*.txt", then open all files with "txt" in directory "c:\", and make a process with all files (one by one).
¿Do it exists any way to do that in NAV 5.0?
Thank you very much.
0
Comments
-
Yes, just search the forum for virtual table "file".0
-
take a look to table 2000000022 (u can only see it if you add it as variable or create a form based on this table.
Search also the forum for 2000000022. I'm sure there are a lot of topics.
regardsDo you make it right, it works too!0 -
Windows Scripting is another option. This is an example the prepares a list of files, in a folder, and then allows them to be processed. I got this idea from another Mibuso posting and modified to meet my needs. I use this is a NAS process to grab files from a remote folder.
Variables FileSystem = "Windows Script Host Object Model'.FileSystemObject" Folder = "'Windows Script Host Object Model'.Folder" Files = 'Windows Script Host Object Model'.Files WFile = 'Windows Script Host Object Model'.File DictionaryFiles = 'Microsoft Scripting Runtime'.Dictionary ScriptControl = 'Microsoft Script Control 1.0'.ScriptControl Script = Text(250) CrLf = Text(2) i= integer n = integer Code Folder := FileSystem.GetFolder(Path); Files := Folder.Files; ScriptControl.Language := 'VBScript'; ScriptControl.AddObject('FilesByName', Files); ScriptControl.AddObject('FilesById', DictionaryFiles); CrLf := ' '; CrLf[1] := 13; Script := 'dim f1' + CrLf + 'For Each f1 in FilesByName' + CrLf + ' FilesById.Add (FilesById.Count + 1), f1' + CrLf + 'Next' + CrLf; ScriptControl.ExecuteStatement(Script); CLEAR(ScriptControl); FOR n := 1 TO DictionaryFiles.Count DO BEGIN WFile := DictionaryFiles.Item(n); // Process Each file in this loop // WFile.Name holds files name END;
There are no bugs - only undocumented features.0
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