Reading file using wildcards

Hello all,

Is it possible to read files from a directory using wildcards? e.g. \\server\directory\aa*.*
I know I can read the whole directory and iterate through the result, but the list can be a large amount of files.

Thanks,

this is, why loops or for…next are for…

Here is a good thread of how to go to through big amounts of folders and files.
Thread

Windows is able to return just part of a folder, that’s why wildcards are invented. If you guys know of a solution within xojo, I would appreciate it you can point me in the correct direction.

Thanks,

A Himmit,

you have to parse and iterate through a folders’ files in order to get your desired, wildmatched result.

  1. Read the total number of Files in Directory
  2. Create Loop and interate through each Filename
  3. Check if name is matching your wildmark.
  4. continue till number of total files reached

thats just an simple algorithm. It’s not fast and there a lot ways to improve this. Otherwise you could run a shell script, obtaining your desired files there, and parsing the results in xojo. There is often more than one road leading you home.

For further Information I suggest to read Xojo eBooks:
https://itunes.apple.com/us/book/xojo-user-guide-book-3-framework/id669685346?mt=11

Thanks guys,

I think I’ll use a windows function to solve the issue.

[quote=119410:@A Himmit]Thanks guys,

I think I’ll use a windows function to solve the issue.[/quote]

A simple shell will give you a text file where to fetch all relevant file names :

dir \\\\server\\directory\\aa*.* > ListOfFiles.txt

FileListMBS class in our plugins is a great way to quickly get a file list.