How to split CSV values in a cell to specific columns?

Hello, I’m trying to split the contents on columns C and D to specific columns on the same or another Excel file.

Check the example:

That’s my data:

That’s the result:

I’m attaching both sample and result for better understanding.

data sample.xlsx (9.6 KB)
data table Results.xlsx (9.8 KB)

Thank you.

Read CSV into datatable.
Use Add Data Column to add the new columns to the datatable.
For Each Row in Datatable

  • Assign CurrentRow(“Coverage Name 1”) = Split(CurrentRow(“Coverage Name”).ToString,“;”)(0)
  • Assign CurrentRow(“Coverage Name 2”) = Split(CurrentRow(“Coverage Name”).ToString,“;”)(1)
  • etc

That’s the basic, strictly manual way to do it. If you want it to be dynamic and automatically add the correct number of columns (ie there can be a different number of values in Coverage Name) then there are ways to do that, also.

Thank You Paul.

As on a learning curve here, I’ll try to do it myself. If i can’t can you send it on XAML file?

Hi Paul.

sorry for ask that, Can yous end an XAML file sample?

Sample of what? What are you trying to do? Is it always the same number of values in Coverage Name and Section Code or do you need it to be dynamic?

It needs to be dynamic.

Source:
Test Split Column.xlsx (8.7 KB)

Result:
Split Column Results.xlsx (6.2 KB)

Code:
Split Column.xaml (14.9 KB)

FYI: Windows compatibility, UiPath.System.Activities v23.4.4, UiPath.Excel.Activities 2.20.2

That’s Exactly what i need!

Thank You very much Paul!