How to check if a string is contains english word

Screenshot (206)

hi all ,

i want to check if row(words example) is contain english words so if yes i want to select the other lang and do some actions on it and rewrite it again in same place.

any help please

Please consider using the Uipath.Cognitive.Activities package. Inside you will find Text Analysis activities that can perform language detection from Google, Microsoft, IBM, and Stanford CoreNLP. If you search online, you will be able to find free API keys for some of these.

Hi @Yazan_Alotaibi ,

Maybe we could Check if there are English Alphabets in the cell using Regular Expressions like below :
image

Expression to be used :

System.Text.RegularExpressions.Regex.IsMatch(yourRowValueString,"[a-zA-Z]")

This would provide you the Output as True even if a Single English Alphabet is present in the row value.

2 Likes

what if i want to select the text

Hi

Hope the below steps would help you resolve this

  1. Let’s take you have a Datatable read from excel and named as dt

  2. Now use a FOR EACH ROW ACTIVITY and pass dt as input

  3. Inside that activity use a Assign activity like this

str_matches = System.Text.RegularExpressions.Regex.Matches(yourRowValueString,"[a-zA-Z]+")

This will give you a list of Match objects ( IEnumerable<Match> ), let’s call it matches , with one element. Let’s call this first match match , so match = matches.FirstAnd if you want to process them and write back to the same excel

Select the word means you can process them,I.e., you can do the string manipulation as you want

Cheers @Yazan_Alotaibi

1 Like

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