trung2403
(Trung Nguyen)
March 3, 2020, 9:45am
#1
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 :
“ABC_”+strInput+"_XYZ"+".xml"
1 Like
karthick
(Karthick)
March 3, 2020, 9:52am
#4
Is your variable strinput hold value as below ?
strinput = “ABC_012345”
FileName
strInput+"_ZZZ"+".xml"
1 Like
trung2403
(Trung Nguyen)
March 3, 2020, 10:04am
#5
Hi lakshman,
I tried your approach as below, but it still does not work. Dont know how to fix it.
trung2403
(Trung Nguyen)
March 3, 2020, 10:06am
#6
Hi karthick,
my variable strInput hold value of a number (e.g. 012345). In file name, I tried: “" + strInput + " .xml” but still not work.
lakshman
(Ganta lakshman)
March 3, 2020, 10:07am
#7
@trung2403
You can’t pass it to here directly.
Use Assign activity and try below expression.
String requiredFile = Directory.GetFiles("FolderPath", "*"+strInput+"*")(0)
And then use Read Text File activity and pass requiredFile to it.
6 Likes
karthick
(Karthick)
March 3, 2020, 10:09am
#8
If StrInput = ABC_0123456_ZZZ
StrInput+".Xml"
1 Like
trung2403
(Trung Nguyen)
March 3, 2020, 10:15am
#9
Many thanks lakshman, it works now. I do appreciate your kind support.
2 Likes
lakshman
(Ganta lakshman)
March 3, 2020, 10:17am
#10
@trung2403
Glad to help you. Happy Automation
Please close this thread by marking above my post as solution.
system
(system)
closed
March 6, 2020, 10:17am
#11
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.