How to remove middle name in datatable

I have a column - Consultant
having a scenario, If Consultant has 3(First middle Last) names, then remove the Middle name. and if it has more than 3 then ignore. and add it in a new column.


1 Like


Try these steps;

  1. Read that excel(required consultant column will be empty)
  2. In a for each row,
    1. Use an assign array_str=Split(row(0), " ")
    2. Then use an if like array_str.count=3
    3. If True, use an assign like row(1)=array_str(0) + " " + "array_str(2)
    4. If False, use an assign row(1)=row(0)
  3. Your dt is ready. You can write it :slight_smile:

Hope it helps.

1 Like

Getting this issue.

It is running but, not giving the correct result.

Could you please check this,
MiddleName_Bot.xaml (10.3 KB)
Sample File.xlsx (72.4 KB)

I think you didn’t change row to string.

i have tried changing to a string, but still, it’s not working.
MiddleName_Bot.xaml (10.3 KB) Sample File.xlsx (73.3 KB)

MiddleName_Bot.xaml (10.2 KB)

Here you go.

You should change ExcelApplicationScope’s path.

1 Like

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