Hello Friends,
As per my requirements, I am reading bunch of files via TextLoader action block giving SourceURL path as /../RootFolder/Folder/MachineName/File.csv
This MachineName is dynamic and I am passing it via Repeater Output. So my Source URL is: "/../RootFolder/Folder" & Repeater_0.Output{Rowsets/Rowset/Row[ID = '#some-value#']/MachineName} & "/File.csv"
This works fine. But sometimes it happens that for some of the machine numbers, there are no File.csv so textLoader gives exception.
To avoid it, I am first getting file list via GetFileList action block giving same URL. IF count of file(GetFileList.List) is > 0 then I am giving the path to TextLoader else doing nothing.
Problem is for some of the machine numbers, this path contains multiple File.csv with different timestamps postfix with File Name such as File20150728188500 , File20150728188790 etc. In this case, I am reading the last file in the TextLoader. But when there are multiple files, GetFileList takes much more time in processing, in generating XML and creating performance problems.
Except to check for file exists or not and to avoid textLoader exception, I have no use of GetFileList. So what will be the optimal way to check for file existence so that TextLoader does not error out?
Soham