How to consider the same values in rows as one record and iterate the subsequent values

Hi All, need help regarding the use case below,

Basically below is my excel file data.

In the ID column, I have to consider the repeated values as one record and have to copy the corresponding columns and get their receipt date, receipt no and receipt amount to check against the PDF file using screen scraping.

For ex, ID 900003 appears 3 times here and I have consider the 3 rows as one record, I need to get the corresponding receipt data, receipt no and amount to cross verify against the PDF file and if there are matches I have to update the record as matched and verified. After that I have to move to ID 900004 and so on and so forth. Can you give an idea on how to achieve this?

Thanks
Zackariya

Follow the below steps -

Step 1: Read Excel data into a Data table
Step 2: Get the distinct ID values of ID column into an array
Step 3: Loop thru an array (distinct values of ID)
Step 4: Take one value at a time and filter the data table based on ID column. The filtered rows will be in a data table.
Step 5: Loop thru the filtered data table and check these values in PDF

Regards,
Karthik Byggari

Hi @KarthikByggari,

Thanks for your inputs. Can you share how to do the below 2 steps?

Step 2: Get the distinct ID values of ID column into an array

How to get the distinct ID?

Step 4: Take one value at a time and filter the data table based on ID column. The filtered rows will be in a data table

Thanks
Zackariya

For Step2:

distinctDT = yourDT.DefaultView.ToTable(false, "ID")

distinctDT will contain unique IDs.

For Step4:

For Each item in distinctDT
{
      newDataTable = yourDT.Select("ID='" + item(0).ToString + "'")
}

newDataTable contains all the rows filtered by ID value.

Can your elaborate on which activities are being used for steps 2 -4?