Ellen
(Ellen )
1
File name is: “test 25300 23-08-2023 team 10.xlsx”
Under the File exist activity when i’m adding file name as
“/test *.xlsx” its not finding the files …
can someone help how to get files when file have spaces and number … only one text “TEST” will be comman for all files and rest will change…
I’m trying to check that do my folder have new files which start with name TEST* …
How can i do that?
@Ellen
Directory.getfiles(folderpath,“TEST.xlsx”).count

Please follow image because * is not coming in site
you try with above provide
cheers
Ellen
(Ellen )
3
no its not working… giving error on the code…
@Ellen
place it in
Assign Activity
Countvariable=Directory.getfiles(folderpath,".TEST.xlsx).count
CountVariable is the datatype of Integer
Cheers
Wildcard might not be supported for the ftp. Check this post for a solution to a similar problem: How do I add a wildcard to a string ...? - #10 by ppr
Ellen
(Ellen )
6
did the same… but still error on acticity
lrtetala
(Lakshman Reddy)
7
Hi @Ellen
Assign Activity:
Left Side: filePaths (Array of String)
Right Side: Directory.GetFiles(“YourFolderPath”, “TEST *.xlsx”)
For Each Activity:
If Activity (Condition: File.Exists(currentFilePath))
Then:
- Add your processing logic here to work with the existing file.
Ellen
(Ellen )
8
still not working…
All my files located on Root of FTP connectiong means have no folder…

I have a foreach loop on IEnumerable object which will go through all files
in that for each im checking is my file name existing perticular date of each file…

This is file name

Remember file have both date and time but i only want to check date not time… and that way i’m writing * at the end.
Local panel shows

This sitll give me false value on FileExist activity…
why… can someone explain?
@Ellen
Did you check the post that was mentioned?
So basically, you would need to fetch all the file names and then use a Linq statement (or a loop) to see if you can find a match.
Ellen
(Ellen )
10
I never used LINQ statemenets…
ppr
(Peter Preuss)
11
Continuing the discussion from How do I add a wildcard to a string …?:
Could look like this
From Enumerate Objects output - myEOResult
arrFilterResult | FtpObbjectInfo Array =
myEOResult.Where(Function (x) x.Name.toUpper().StartsWith(“TEST”)).ToArray
then you can loop over the arrFilterResult and retrieve Name / Full Name
EDITED: sharing another Filter LINQ sample
(From x In myEOResult
Where x.Type.Equals(FtpObjectType.File)
Where x.Name.toUpper().StartsWith("TEST")
Select o = x).toArray
we filtered explicitly for files and blocked folders
ppr
(Peter Preuss)
12
Ellen
(Ellen )
13
it’s difficult to understand.
Is there no easisst way?
ppr
(Peter Preuss)
15
ppr
(Peter Preuss)
17
Yes, but we can also derive some good hints from the validation message: there is a datatype missmatch

we are handling FtpObjectInfo objects
Ellen
(Ellen )
18
Agree I corrected that after I post picture and now its giving error on myFilterResult which is a list of String as datatype
ppr
(Peter Preuss)
19
output - Enumerate Objects: DataType: IEnumerable(Of FtpObjectInfo)
myFilterResult - DataType: List(Of FtpObjectInfo)
Do not omit to initalize the myFilterResult before usage with
myFilterResult = new List(Of FtpObjectInfo)()
Ellen
(Ellen )
20
and
have also tried with this …