How to retrive matched data

Here need to check given text input with the text present inside table column-A and need to fetch only matched text. from the given text input .

For eg: Text input =“MILLERS POINT NSW”

check with column-A values and extract the matched text from textinput.

MILLERS POINT NSW is matched with column A value MILLERS POINT

extracted text should be MILLERS POINT NSW

Try this:

  • Read Rage - DtOut
  • For each row in data table - Pass DtOut
  • Take one if condition and pass the expression like this:
Textinput.Contains(CurrentRow("ColumnName").ToString.Trim) 

In then Block you will get the Matched records

now take one assign actiity and pass the expression like this

strMatched1 = CurrentRow("ColumnName1").ToString.Trim
strMatched2 = CurrentRow("ColumnName2").ToString.Trim
strFinal = strMatched1+" "+strMatched2

That’s it

Regards,
NaNi

Hello @srujana13a5

Have you tried with Filter Datatable activity?

Thanks

Hi @srujana13a5 ,

We would need to understand with more sample data what is actually required to be done. Considering the case provided, the search string contains more words than the one in the Excel sheet column. Maybe if this is the case, we could try with the below Linq Query :

extractedValue = DT.AsEnumerable.Where(Function(x)searchValue.ToLower.Contains(x(0).ToString.ToLower.Trim)).First.Item(0).ToString

Here, DT is the Datatable which contains the data from the Excel sheet, searchValue is the input text to search, extractedValue is a String type variable.

We might need to handle exceptions but let us know more about different cases.

for example this is my address text
5 14 ST THOMAS STREET BRONTE 2024 61409576525
In this address text BRONTE is my suburb
Need to compare suburb with the filter data
Extracted postal code 2024 and filtered in below excel sheet
SYD.zip (23.3 KB)
image

Another example
20 OLD FARM PLACE OURIMBAH 2258 AU473935456
In this text OURIMBAH is the suburb
need to compare this suburb with below excel
image

@srujana13a5 ,

Have you Checked the Expression provided above ?

image
some times my extracted suburb is FOUNTAINDALE
At that time I need max match count and that I need to take as my suburb

Hi @srujana13a5 ,

try below query

Dt=DataTable.Select("Column1 Like '%FOUNTAINDALE%'").CopyToDataTable()

Regards,
Arivu

a={ “BENNELONG POINT”, “CENTRAL STATION”, “CHINATOWN”, “CIRCULAR QUAY”, “COCKLE BAY WHARF”, “DARLING HARBOUR”, “DAWES POINT”, “GARDEN ISLAND”, “HAYMARKET”, “MARTIN PLACE”, “MILLERS POINT”, “ST JAMES”, “SYDNEY”, “SYDNEY CBD”, “SYDNEY GPO”, “SYDNEY TOWN HALL”, “THE DOMAIN”, “THE ROCKS”, “UNIVERSITY OF TECHNOLOGY”, “WALSH BAY”, “WHITLAM SQUARE”, “WYNYARD”, “BARANGAROO”, “AS DIRECTED”, “CIRCULAR QUAY WEST”, “King Street Wharf”, “SYDNEY CENTRAL RAIL STATION” }
this is the array
address suburb is “MILLERS POINT NSW”
compare this suburb with above array and i need maximum match

Thanks in advanced

Hi @srujana13a5 ,

Can you provide the input datatable and expected output

Regards,
Arivu

@srujana13a5 ,

We would need to understand what is meant by max match count for your case. Also indicating which is the required value to be selected will help us in analysing the logic used or confirmation on the logic to be applied.