Filter file started without "$"

Hey developers,

I have actitie who read all file in folder.
I would like to filter without “$” in the name.

Do you have an idea when i could make ?

image

Thanks for your returns !

HI @Mateo_Drouillard

Welcome to UiPath community

Can you tell us the Filename?

Regards
Gokul

The filename can change but it’s all time .xlsx
The foldername is : “.…\Ready”

@Mateo_Drouillard

Welcome to forums

Inside for each you can put a If condtion as below

path.GetFileName(Articles.ToString).StartsWith(“$”)

Then-> means you have $ in filename starting
Else → It’s not started with $

Hope this may help you

Thanks

HI @Mateo_Drouillard

You can try with Regex expression : IsMatch

Use If activity

System.Text.RegularExpressions.Regex.IsMatch("Input File","\$")

image

image

Regards
Gokul

You can use something like

Directory.GetFiles(folderPath).Where(Function(file) Not file.Contains("$")).ToList()

this will give you the list of files without $ in them

Thanks

i would like to take only file don’t start with “$”

Directory.GetFiles(folderPath).Where(Function(file) Not file.StartsWith(“$”)).ToList()

you can use this as well

1 Like

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