how its possible to read a extrem long excel List row by row and column by columns until an empty field comes ?
Read Row1 in Excel the first Cell and INPUT in a Homepage. Than read the second Cell in Row 1 (Column 2) and Input this in a Homepage.
Then Jump in Row 2 in excel read the first Cell and Input in the Homepage. Then read the second Cell in Row 2 (Column2) and Input
Hello @Hovarda52, use “Read range” activity to read such list. Provide empty string in “Range” property as you might not know the exact range of the list. This activity would give you the data in form of a datatable which you can traverse using For Each row activity.
foreach (Row in dtOutput.Rows)// For each row
{
foreach(Col in dtOutput.Columns)// For each column of a row
{
If( Row(col) = "Emp_Name")
{
// activity
}
}
}
One could use .TakeWhile here as well, if you want to iterate until a condition is met:
// Take rows until nested function returns false, in this example if first cell value = END it will break out of the loop
foreach (Row in dtOutput.AsEnumerable.TakeWhile(Function(x) x(0).ToString <> "END"))
{
// your processing here
}
Tha way you avoid additional nesting which can make the workflow much less readable and you don’t need an exit condition inside the loop.
It depends on what you’re used to, but I find it much more readable. Same goes with .SkipWhile if you need to skip until some value is found (a date later than today for example).
Hi
I tried reading rows thru first while loop and columns thru 2nd while loop, so that could print cell contents. But its not working. Attaching script. As, I’m new user, unable to attach my script here. Could some one please help me on this. Thanks
HI,
I Want to select rows (based on my need) from excel sheet.
For example, first time I need first 10 rows and for the next time i just need 15 rows.
Could anyone tell suggestion for this.
Use the DataTable variable that you got from “Read Range” activity. And pass it in “For Each Row” activity as input. Then, it’ll take care of your need.
Example:(From your sample data)
First row comes as Datarow like user1 pswd1 under their respective columns. All you need to do for your scenario is pass the current variables to your respective text boxes (Webpage login)
Hy I have the same problem of Hovarda52, I woul to read a long excel List row by row and column by columns untile empty field comea. Read Row1 in Excel the first Cell and INPUT in a Homepage. Than read the second Cell in Row 1 (Column 2) and Input this in a Homepage.
Then Jump in Row 2 in excel read the first Cell and Input in the Homepage. Then read the second Cell in Row 2 (Column2) and Input
As long as an empty field comes
Please anyone can help me
Yhanks