How to filter an excel column that start with a specific word?

Dear Experts,

Possible to read an excel column text start with certain wording and extract out to a web column?

Scenario here is that im trying to copy a text from excel column which may start with “OUT*****” or “M*******” ( * means certain numbers )

So i was trying to use an activities like

a) Excel Application Scope
b) Read Cell ( output as Data )
c) Filter Data Table ( for which im stuck here ) dont know how to read specific word start with OUT or M and copy into a web column

Excel data
image

in UiPath activities

Hope i could get some idea and solution to make this workable

Thanks!

Hi @Alfred_Gan could you try with contains method in filter?

e.g
columnName. contains out
Or
columnName.contains M

for ref.

  1. Read Range
  2. For each row loop
  3. in filter data table activity : row(“colname”).tostring.contains out or row(“colname”).tostring.contains M1

image

HI @Alfred_Gan

You need to use read range not read cell

Check with read range and pass that variable in filterdatatable

Regards
Sudharsan

Hi @Alfred_Gan, hope you are doing well, after reading data table by using read range activity, you have to read data using for each loop and then put a condition there like

“string.contains(“out”)” or you can also use the regex for the purpose of extracting specific information. Here is the given link for regex:

Hey @ try this linq
dt.AsEnumerable.Where(function(row) row(columnname).ToString.ToLower.StartsWith(“m”) or row(columnname).ToString.ToLower.StartsWith(“out”) ).CopyToDataTable

also use read range for reading the excel data

Regards

Sreejith S S

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