Split values in excel file, and write in new column in same sheet

Hi RPA developers,

I need help:

In Excel file in one column (D) I have values:
EEPL1Training Fees
ML001Training Fees
ML014Training Fees
ML014Training Fees
ML014Training Fees
ML015Training Fees
I want to split, example:
EEPL1 Training Fees
ML001 Training Fees
ML014 Training Fees
ML014 Training Fees
ML014 Training Fees
ML015 Training Fees

And result ( EEPL1, ML001, ML002, ML003…) write in same excel file like new column (column Name ID ), and Training feeds I want to stay in same column like Description.

Can anyone help :slight_smile:
Cheers

@Gagi77

You can do it in the excel file alone
image

If you want to do it in the bot logic, you need to loop through your datatable and split each row
myStr = “EEPL1Training Fees”
strID = myStr.Substring(0,5).Trim
strDesc = myStr.Replace(strID,“”).Trim

@JGuarino Nothing has changed buddy
EEPL1Training Fees EEPL1Training Fees
ML001Training Fees ML001Training Fees
ML014Training Fees ML014Training Fees

image image

@Gagi77

It’s because you have not changed the contents of your out_DT2.

I believe you cannot update your out_DT2 while using it in a loop.

Try creating a new Datatable:

Before Loop:
myDT = New Datatable

Inside Loop:
myDataRow = myDT.NewRow
myDataRow(“ID”) = str_CC
myDataRow(“Description”) = str_Desc
Use “Add Data Row” activity to add “myDataRow” to “MyDT”

After Loop:
Write Range: Write contents of myDT instead of outDT2

@JGuarino Done, thank you buddy, you have beer :slight_smile:
Cheers

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