How to get the Excel data Values by increasing value of cell value one by one

Hi i have a scenario. in which there is two column headers is there ((A1) and (B1) is the cell values of column headers) so under each column headers there is statements is there, i want to read the excel and i want to get the each statement under the columns by looking at their cell values in the increasing order of cell values like (A2 cell value after that A3 cell value and after that A4 cell value like this way) likewise i need the second as well (for B2 after that B3 and B4 and B5 like) is there any logic to get the values like this without using filter data table and by using manipulating the data table with increasing order of cell value to get the value in the each cell for the same ?

please find the image for the sample

Kindly help me to get it done

Thanks in advance

Hi @chandolusathi.kumar ,

Have you tried using the For Each Row Activity ? This activity would require a Datatable which would be your Excel Sheet data read using Workbook Read Range Activity.

Let us know if this is not what you are looking for and explain in a bit more detail the requirement.

Hi @chandolusathi.kumar, if you are simply trying to access the data from the DataTable, you can simply use ‘For Each Row In Data Table’ activity and obtain column values by using CurrentRow.Item(“Statement1”).ToString and CurrentRow.Item(“Statement2”).ToString

You need to read excel data using ‘Read Range’ activity and have ‘AddHeaders’ checked for this

image

for each row will take long time i need the quick solution either by using LINQ or any other method to get process a greater number of lists like 10000 of statements

kindly suggest some method

i want to get bulk no of statements so for each will take long time, so i need some other method to get process 10000’s of statements within small period of time like using LINQ method or some other methods. kindly suggest some other method

@chandolusathi.kumar

Can you be little more clear on what you need…

As per the request I see you need each row separately for that that you have to use for loop…

Are you looking to perform any specific task on each row…or do some manipulations…can you please elaborate

Cheers

i want each cell value from A2 after that A3 and after that A4) likewise similarly for “B” Column as well.

@chandolusathi.kumar

This is called a loop

If you dont want to read whole datatable then you can directly use for each row in excel activity…

Cheers

Hi @supermanPunch kindly help me to get it

Read Range into a datatable the For Each Row in Datatable.

You cannot avoid looping. LINQ loops. It’s a myth that For Each is slower than LINQ. LINQ has For Each inside it, anyway. It just hides it from you. There is no way around the simple fact that it will take time to process tens of thousands of statements, which is why you need to use a dispatcher/performer model with a queue so you can scale your automation to run multiple jobs at one time.

i don’t want use loop, some other method like LINQ or other method. i need to process bulk no of statements. kindly check some other alternatives to get the cell values by increasing the cell value and get the corresponding cell values.

@chandolusathi.kumar

I am little confused here…linq can be used to process many items at once…if you want one item per iteration…then you can go only with loop…

Please tell your complete requirement on why you need this…may be that would help in understanding and giving more inputs

Cheers

LINQ still loops, it’s just more hidden from you. You can’t iterate through a list of data without looping. It’s a myth that LINQ is faster than For Each. If you need to process a lot of statements then you need to do a dispatcher/performer model and write your performer so it scales to be able to run multiple jobs at one time.

@chandolusathi.kumar Anil is correct here. If your goal is to perform some steps for each item then you MUST use some sort of For Each with the steps inside it.

@chandolusathi.kumar ,

Could you let us know what is the End Output you require for the Input that you have provided in the First post. Do provide the output data in terms of File/Screenshot, this way we can avoid to and fro convo and get to understand the requirement clearly.

We can then suggest the appropriate suggestion for your case.