I want to split the value in same cell into separate cell/row in excel.
but the value from other column need inherited to new row
not sure if my description is clear enough, i put the example as below.
is it possible to be done by Uipath activity?
Please give me some advice.
Hi!
I have created a workflow for your situation which contains also an Excel file. I supposed that you know the separator of the elements in that row. SplitRow.zip (28.1 KB)
Hope it would help you!
Thanks for your reply !
it looks like that you workflow just read the sheet1 that has been split.
But for that example, what i want is to split row2 (Number:7661) into 4 different row by each “name”, and copy “Number” and “Date” value to those 4 new row as fig.2.
Besides, currently in fig.1 , looks like the value just separated by “Alt + Enter”, so i’m not sure what separator is using.
Could you kindly explain how your workflow works for me and correct me if i have misunderstanding.
Thank you.
Hi!
In sheet1 was the processed data table after the run.
I have modified the flow and I left sheet1 with your dt as shown in the example so you can test it.
In the case of ALT+Enter separator it is used vbLF to identify it.
vbLF is a constant.
The new flow contains vbLF as identifier for the multiple value row.
I have explained the steps in the attached workflow.
I figured out that my annotations weren’t saved in the flow. I’ll leave them here.
First it reads the sheet and it saves values in dt variable. Index Last Row is initialized to 0 because we havent processed any row yet.
While is used to loop through the datatable and to re read it after the changes until it reachs the last row.
If it finds a row with multiple values the robot inserts rows at that position. The number of rows is the number of the elements found in that cell -1, to keep the row from where we started.
In a new datatable with the same format as ours we add the row that has only the name changed and write it as a range in excel until we reached the maxim number of values in that cell.
Break the loop to re read the changed dt and assign the last row index that was processed to verify it in the begining of while loop.