Problem with File path in Read Text File

I had several files in a folder (e.g. ABC_012345_XYZ.xml; ABD_234567_DDD.xml; ABE_543210_ZZZ.xml). A variable (strInput) is the defined number (e.g. 012345; 234567; 543210) where I can type in from Input Dialog activity.

I would like to use Read text file activity to load content of a specific file. So, in the Filename, I put: “"+strInput+"”+".xml"

However, it seems UiPath does not get the file.


Anyone can help with the above issue? Thanks

@trung2403 Are you using the filename in this way :

1 Like


It should be like this:

1 Like

Is your variable strinput hold value as below ?

strinput = “ABC_012345”


1 Like

Hi lakshman,

I tried your approach as below, but it still does not work. Dont know how to fix it. :frowning:


Hi karthick,

my variable strInput hold value of a number (e.g. 012345). In file name, I tried: “" + strInput + ".xml” but still not work.


You can’t pass it to here directly.

  1. Use Assign activity and try below expression.

                String requiredFile = Directory.GetFiles("FolderPath", "*"+strInput+"*")(0)
  2. And then use Read Text File activity and pass requiredFile to it.


If StrInput = ABC_0123456_ZZZ


1 Like

Many thanks lakshman, it works now. I do appreciate your kind support. :smiley:



Glad to help you. Happy Automation :slight_smile:

Please close this thread by marking above my post as solution.

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