I try to use: directory.getfiles(config(“DownloadFolder”).toString, “.xsl|.xlsx|*.pdf”)
But it doesn´t work, it says that there are Illegal characters in path.
Is another simply way to do it?
Hello @dulce.santacruz
try this
Directory.GetFiles(Yourpath","*.*",SearchOption.AllDirectories)
Otherwise you can use For each file in folder activity
Hi @dulce.santacruz
Try this
Directory.GetFiles(path, “.”, SearchOption.AllDirectories).Where(Function(s) s.EndsWith(“.mp3”) Or s.EndsWith(“.jpg”))
If it says illegal characters in the path, what value is in config(“DownloadFolder”)?
It´s the name of the folder where my documents take place before download it I check it individually and what makes the error are the: *pdf…
e.g.
arrFullFilePaths | String() - String Array =
(From f in Directory.GetFiles(MyDirPathVar)
Let xt = Path.GetExtension(f).toUpper.Replace(".","")
Where {"PDF","TXT","XML"}.Contains(xt)
Select fp = f).toArray
Taken from:
@dulce.santacruz
Here’s another way to achieve that
Directory.GetFiles(“C:\path”, “.”, SearchOption.AllDirectories)
.Where(file => new string { “.jpg”, “.gif”, “.png” }
.Contains(Path.GetExtension(file)))
.ToList();
Let me know if that works
Thanks! I tried with the other answer that you send me, and I can´t make it work, let my try this, thanks!!
What means the square before string?
How about this expression
Directory.GetFiles(Environment.CurrentDirectory+"\WordPdf\","*.*",SearchOption.AllDirectories)
SearchOption.AllDirectories - Used for searching all the directories in the mentioned folder path
Check out the tutorial
Regards
Gokul
@dulce.santacruz
The square is the array symbol, it does not display very well in the comments.
Here are the two ways to do it:
myProcess.zip (34.1 KB)
BusinessException.zip (61.9 KB)
Let me know if it works
Yes, it works!
Please as text because this file is not open in my old uipath
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.