Use directory.getfiles(path,"*.*")

Hi!
I’m trying to check the file name using getfiles I know.
But what does ‘directory.getfiles(path,“.”)’ mean?

Hi @dlqhqo98

Directory. GetFiles is a Fuction the Used to fetch the Files From the Folders.
Directory -->Specfies Your Folder.
GetFiles—>Specifies the Files in the Folder.
(“Path”,“FilterConditionBased on File Type”)–>Specfies (“YourDirectoryPath/”,“*.xlsx/txt/…”)

Regards

1 Like

“.” means you read all files regardless what is the name and what is the file type.
If you want special name you can write → “Yourfilename."
If you want special file type but the name is not important, for example only Excel → "
.xlsx”
But if you know the name and the file type, you can set both here → “Yourfilename.xlsx”

Best regards
Mahmoud

Hi @dlqhqo98

It means like

Eg:
Directory.Getfiles(path,“.pdf”)
Your current Directory of the local machine.Get the files in the (Specified path, which only has the extension of pdf )

Regards
Sudharsan

I wrote:
Directory.GetFiles(C:\Users\Belen\Downloads;“*.xlsx”)
And the error says:
Argumento ‘Value’: (1,122): error CS7017: Se esperaba una definición, una instrucción o un fin de archivo
image

you should be using
Directory.GetFiles("C:\Users\Belen\Downloads","*.xlsx")

1 Like

Thank you, buy It’s didn’t work…
image

Neither this way:
image

Hi @bvaldez - Can you remove everything and type manually in Assign activity

Directory.GetFiles("FolderPath", "*.xlsx")

Output variable should be of type Array Of Strings

1 Like

It’s doesnt work…
The variable, carpetadestino is array of string…
The language of my project is C#. How’d be the sintaxis?

@bvaldez Try either of this syntax
image
image

Hope this works.

@bvaldez - Can you try the below one

Directory.GetFiles (@"C:\yourfolderpath","*.xlsx")

Output variable should be of type Array Of Strings