How to find if the file exist in FileList or not in Document Understanding

I am working on Document understanding for the two different templates without using ML Extractor. I just wish to segregate the files coming from mail on the basis of file list.
but when I am using FileList.Contains(“TMS”).ToString , it is giving me false as an output and reading no file contained in the folder.
*Where TMS is a start of file name.
Can anyone provide me the solution for these??

Hi @Kunal_Jain ,

Is the FileList an array or a List of String type variable ? In that case, only if the file name is just TMS it would provide Output as True. If TMS is just a part of the file name then it would give you False as Output.

Maybe you can use the below Expression to Check if any filename contains TMS in it or at the Start :

FileList.Any(Function(x)x.ToString.ToLower.StartsWith("tms"))

Hello @Kunal_Jain ,

Please try as below.

fileList = Directory.GetFiles (strFolder, “TMS”, System.IO.SearchOption.TopDirectoryOnly)

strFolder=Folder path
fileList =FileList is an array of String type with file names.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.