Rup_1
(Rupesh)
February 2, 2023, 10:33pm
1
Hi Friends,
Lets consider my input file name for bot processing is : TestFile_XYZ
(Note : XYZ is username)
sometime file name for bot processing is : TestFile_xyz
so how we can get correct file name, no matter username is capital or in small letter.
Hi @Rup_1
We can use Regex or String Manipulation to achieve this. Preview the pattern here .
Use it an assign like this:
Left Assign:
strResult
Right Assign:
system.Text.RegularExpressions.Regex.Match(YOURSTRING, “(?<=_).+”).ToString
OR
You could split on the character “_” and get the 2nd result.
You can learn Regex here:
You can learn String Manipulation here:
How to manipulate a part of string: Split, Trim, Substring, Replace, Remove, Left, Right - News / Tutorials - UiPath Community Forum
Hopefully this helps
Cheers
Steve
Yoichi
(Yoichi)
February 2, 2023, 11:33pm
3
Hi,
In Windows OS, as file name is case-insensitive, difference of upper and lower case letters in filename has no effect.
Do you have any problem? If it’s necessary to compare their equality ignoring case, we can use ToLower or ToUpper method like
filePathA.ToLower = filePathB.ToLower
Regards,