I have excel file as follows:
I want to get lines with “Role = Builder” but I don’t know how to get them.
Can anybody help me?
Follow the Following steps.
- Read the Excel file using read range and store it in Variable suppose dt.
- Use for each row To read the data table row by row.
- Get the Value of Row using row(“Role”).ToString and store it in RowValue variable
- Below that use If Condition And give RowValue= “Builder”.
- Inside the then Section Of the If Activity Perform the operations Which you want to perform.
Thanks & Regards
but i want get data follow row index.
you can help me get data follow rowindex?
hope these steps could help you resolve this
–use excel application scope and pass the file path as input
–use read range activity and get the output with a varaible of type datatable named outdt
–use a for each row loop and pass the above variable as input
–use a if condition inside the loop mentioning like this
if the condition passes it will go to THEN part where we can get the row index
like in a write line activity
Do you want the data of the row which contains “Builder” If yes
Then Follow the above steps and in The Then section Of If Condition.
- Get the Employee Using row(0).tostring In Employeee Variable.
- Same way Get the Location using row(1).tostring In the LocationValue variable.
And if you want to add these value as row in data-table then use Add data row activity and in the array row Give this variables as a array.
- So it will give you the data of Row which having the value of Role as Builder
If you want to get the value of row 3 then use datatablevariable.rows(rowindex)(columnIndex)
its very simple buddy
if we want to get the data from any line like any row from the datatable
we can mention like
where both the row index and column index starts from 0 for the first row and first column
Hope this would help you
change the excel path and “dt1.Rows(2)(2).ToString” ,“dt1.Rows(4)(2).ToString”,“dt1.Rows(5)(2).ToString”,“dt1.Rows(7)(2).ToString”,“dt1.Rows(8)(2).ToString”,“dt1.Rows(10)(2).ToString”
My problem has been solved. thank you very much
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.