Loop data table

Could anyone tell how we can iterate over data table . means
if we are making for loop as below

for i in datatable
row(0)- gives the first row but if try to get second element similarly as row(1) - then it says out of range.

i just want to read the file which have one column and i want to read row by row or read first 2 rows then next 2 rows.

could any one help please.

Hi @kapil_sharma,

You can use for each row activity to loop through all the rows the datatable.

And, row(0), will give you the first column and not first row , In your case, row(1) is giving you an index out of range exception because there is only one column in your excel file.

I am using for each row item but how can i access the 2 or any row at any movement.if row(1) says column .?

Your for-each row does the work of going to the next row until it fetches it all. i.e 1 to n number
What you do inside the for-each will apply for each row cell.
So you may do writeline [row(1).toString] for example, when you execute, each row cell(as you have only one column) value will be printed.