Hi,
I need to get all the values from columns A,B,C from the row 12
datatable.Rows(12)(“A”).ToString
datatable.Rows(12)(“B”).ToString
datatable.Rows(12)(“C”).ToString
If you already have the values in a datatable then @Debakanta_Mahanta already gave you the solution. If not - just use “Read Range” activity and specify the range you need:
If you want to get all column values from a particular row then
Use a WHILE Activity like this
counter < datatable.Columns.Count
Where counter is a variable of type int32 with a default value of 0 defined in the variable panel
Then inside the loop use a writeline activity where mention as datatable.Rows(11)(counter).ToString which will display the values of all columns in the row12 one by one and I mentioned as 11 as the rowindex starts from 0 for the first row
Or if we want to store all values of that row in a variable then use ADD TO COLLECTIONS activity instead of writeline activity
Where in the items property mention as datatable.Rows(11)(counter).ToString and in the collections property mention as list_value
Where it is a variable of type System.Collections.Generic.List(of string) with default value as New List(of String) define din the variable panel
Cheers @raghuramk
@Obsev
with the keyword onwards from the title requirement is understood as following:
- excel is read in into a datatable
- rows with rowindex > 11 are of interest
with yourdatatable.AsEnumerable.Skip(11).CopyToDataTable will reduce the datatable and omit the first 11 rows and you can assign the returned datatable to a new datatable variable (suggested) or overwrite the origin datatable
Access to the columns are as usual to handle with e.g yourDataRow(ColumnNameOrIndex)
That is true, sloppy reading from me…