How to check the text file contain some special words?

For example,i have a text file called abc.txt.
I want to know whether it contain the word “apple” or not

2 Likes

Read the file using “Read text file” option and check the resultString using resultString.Contains(“apple”). It will return true or false depending on the search result

2 Likes

thanks

Best regards

BTW if i want to set a variable called Time as the current time,and check it equals the resultString (2018/09/11) from the text file?

Hi,
Try this. Hope it helps…:sunglasses:
Main.xaml (5.7 KB)

1 Like

You’re so coool ! THX !
Do you have some websites or information for more UiPath knowledge~

https://academy.uipath.com

1 Like

Assign Time value as DateTime.Now.ToString(“yyyy/MM/dd”, System.Globalization.CultureInfo.InvariantCulture) and read the file content using Read Text File activity. The result will be a string variable, compare the resultString with the Time variable using resultString.Trim.Equals(Time) using if activity.

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