How to use * in work path


May some part of the path of file be anything? i tried to put * like i do in excel but didnot work. Is there any way to do it?

I tried this path “C:\20191216_Lko_”+"*.xls"

LKO_*******.xls. * part can be anything with no pattern. So is there way to write the path?

Thank you so much

Hi @koksala

Try like this


Ashwin S

may i know where it was mentioned
if possible a screenshot of it pls
Cheers @koksala

You can’t use directly wildcard characters in the file path.
But you can do it in the following way -

Use Directory.GetFiles method to get the desired file using wildcards.
Assuming there is only one file matching.

Sample File Name: LKO_TestFile_Sub.xls

strFileName = Directory.GetFiles(folderpath,"LKO_*.xls")(0).ToString

strFileName contains the full path of the file.
You can pass this file name in your workflow.

Karthik Byggari


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