Two names separated "," , how to get it

Hello smart people

The flow is need to input NAME and City into the system from the Excel.
The problem is data “Name” column has one more names in the row , like “DiDi,May”
For those rows(if the name has “,” , split the name) and i have to input into the system like
Name=“DiDi” City=UK update button
Name=May" City=UK update button

i do not know which steps are the best way to implement this work.

Thank you in advance .
eimon

Hi

So I would Build new dataTable (DataTable1) first and then implement For Each Row on dataTable Excel1.

In the For Each loop I would create If to check:

Is row(“Name”) contains “,”

If condition is True
Create another For Each loop inside, but this time iterate on an array:

row(“Name”).ToString.Split(","c).ToArray

And add results to new dataTable using Add Data Row

So the value of the column Name in DataTable1 would be string from array with names. And value of the column City would be row(“City”) taken from first loop.

2 Likes

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