How to add reference number for every 10 rows while adding to queue

Hi All,

I have excel which i want to add to queue. I want to add every 10 rows reference number. How to add that.
Example: Like 100 rows i have i want to add reference number in 10,20,30,40 th row.

Please help me

@thima Are you using REFRAMWORK?

Here is Pseudo code:

  1. Read the Excel file: Use the Read Range activity to read the Excel file and store the data in a DataTable variable.
  2. Iterate through the rows: Use a For Each Row activity to iterate through each row in the DataTable.
  3. Check the row index: Inside the loop, use an If activity to check if the row index is a multiple of 10. You can use the Modulo operator (row.Index Mod 10 = 0) to check if the row index is divisible evenly by 10.
  4. Generate a reference number: If the row index matches the condition, generate a reference number using your desired logic.
  5. Add the reference number to the row: Assign the generated reference number to a new or existing column in the current row.
  6. Add the row to the queue: Use the Add To Collection activity to add the row (or a specific column) to a queue. Ensure that you have already created the queue variable.
  7. Continue the loop until all rows are processed.
1 Like

Hi,

Take a counter value initialize to 1
Add a item to the queue everytime. Increment the counter after adding the item to the queue
In the if condition if the counter value is divided by 10 which gives the result 0 Give a reference number to it.

Thank you

Hi @thima

Within the For Each Row activity, use an If activity to check if the current row’s index matches the desired reference number rows (10th, 20th, 30th, 40th, etc.).
You can use the “rowIndex” property of the For Each Row activity to access the current row index.
Inside the If activity, use the Add Queue Item activity to add the reference number to the queue.

Hope it helps.

[quote=“raja.arslankhan, post:2, topic:562324”]
row.Index Mod 10 = 0
[/quote

Thanks a lot its working

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.