I’m working on a data table manipulation, where I’m trying to copy paste the data from previous row in the empty rows until a values comes up.
In row1 I have value ISA001 and next 5 rows are empty, the empty rows needed to be filled with the row1 data. And in row 7 I have value ISA002 and next few rows are empty and needed to be filled with row11 data and so on., I’m attaching a screenshot for reference.
Note: the number of empty rows are not constant.
Can anyone please help me with a logic to accomplish this task.
Thanks in advance.
try as below
Using excel scope , use excel file
for each row activity to iterate through rows
use if condition to check if it is empty
String.IsNullOrEmpty(CurrentRow.ByField("Segment")) = true OR String.IsNullOrWhiteSpace(CurrentRow.ByField("Segment")) = true
then block use fill range or write cell activity for now i have used fill range
and provide value of text you read from else block
else block use read cell activity and store the value in a varibale
Hope this helps
@LAKSHMI_NARAYANA_PEMMASAN , @raja.arslankhan . Thank you for your replies. I have figured out the logic my self.
I’m actually manipulating the data table and not excel. The solution for my issues is as follows:
I’m looping through the datatable and inside for each row for data table I’m took IF block.
The condition for IF is currentrow.item(“Segment”).tostring.trim = “”
Then currentrow.(“Segment”) = dt.(idx-1)(“Segment”).tostring
where dt is the datatable that i’m looping and i’m taking the index of the for each row in datatable and getting the value of previous cell by subtracting the index by 1.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.