input is like this as shown in input image
i want output as shown in output image
input is like this as shown in input image
i want output as shown in output image
Build data table with 4 columns as per image 1 → dtOutput
Read cell activity to read the cell value A2 and save to strInput
Read other cells values → strStatus, strClass and strSubject
Split the string → strArray = strInput.Split(“,”)
For Each str in StrArray
{
Add row to a datatable dtOutput → str, strStatus,strClass and strSubject
}
Export the dtOutput to Excel.
Regards,
Karthik Byggari
could u please share workflow
Please find the workflow for your requirement. I am also attaching the excel file for your reference(check Sheet1 for input and Sheet2 for Output).
Note: Please change the excel file path as per your requirement.
@KarthikByggari - Hope this is what you meant.
Thanks and Regards,
@hacky
SampleExcel.xlsx (8.2 KB)
Main.xaml (12.1 KB)
u have fixed cell in read range
It can be many rows
and it not fixed that col A will contain ,
it can have only one number also
You need to try a bit by your self mate… You just need to use loop to iterate through rows.
I would suggest you to go through academy, its amazing…
I think its not a goot practice of uploading the workflow…
It would be good if you can specify what you have tried, where you have stuck, what issue you are facing.
Thats interesting, I shared a code with respect to what example you gave.
But anyways, this is possible, because, when you read cell(Value of RollNo), you can have track of number of roll numbers per cell.
Again, I assume that we have multiple values only in the case of RollNo, so its easy to keep track of the values in the Column “RollNo” and Add multiple rows with respect to it,.
Hope this makes sense to you.
Thanks and Regards,
@hacky
Hi @Ananya1
I gave you the steps assuming you have only row. If you have multiple rows please try the following. I recommend you to try the below in your studio and if you face any issues we will support.
dtOutput
dtInput
For Each row in dtInput
{
strArray = row(0).ToString.Split(",")
For Each str in StrArray
{
//Add row to a datatable using Add DataRow Activty
dtOutput -> {str,row(1).ToString,row(2).ToString,row(3).ToString}
}
}
Try to implement this in Studio.
Regards,
Karthik Byggari
Can you share the Add Row Activity properties screenshot
Please refer the example here how to add row to a data table -
i want to delete that rows which contain commas
Use Filter Data table activity -
Give condition as → “RollNo” Contains “,” → Select Rows Filtering Mode “Remove”.
Rows Filtering Mode - Specifies whether to filter the rows by keeping or removing them. This can be done by selecting the Keep or the Remove radio buttons. Selecting Keep only keeps the rows that meet the specified condition, while selecting Remove removes the rows that meet the specified condition.
Refer -
https://docs.uipath.com/activities/docs/filter-data-table
Regards,
Karthik Byggari
Thank you @KarthikByggari