I want to filter .xls files in a folder and I use this filtering option and it doesn’t work. Can anyone help me on this?
have a look on following statements:
Directory.GetFiles(“YourDirPath”, “*.xls”)
will filter for files with extension xls and returns a strring array with the found filenames
Path.GetExtension(“C:\test\abc.xls”)
will return: “.xls” - including the . the dot is missing in your statement
Maybe there is a missmatch between upper and lower case and can be fixed by
System.IO.Path.GetExtension(file).toUpper.Equals(“.XLS”)
May be using Contains
System.IO.Path.GetExtension(file).Contains(“.xls”)
Inside the Equals I think that you need a point before the extension (“.xls”)
@anon86233825 You try this also
Directory.GetFiles(“C:\Documents\folder1”,“*.xls”)
Use for each loop activity and perform the rest of the activities in the for each loop one bye one
Best Regards,
Vrushali