Identify range numbers

I have an excel sheet with varying invoice numbers. Some of them are continuous and some random. Example {122,123,124,125,127,173}. How can uipath identify these? I want uipath to identity the numbers that are in continuous range (122 to 125) and also the single numbers(127,173) that are not in range

@arub_mathew I have attached a workflow please go through it and let me knowMain.xaml (19.4 KB)

Hello thanks for your reply. I am a bit confused since I have the invoice numbers in an excel sheet. So what I want to do is send {122,123,124,125} as one batch then 127 and then 173.So all together 3 separate batches. Also the excel sheet is dynamic day to day and it varies.

I cant create dynamic list based on the number of invoices since it varies? Should I use for each row and then push the invoices from excel to a list?

Yes you can create lists for to store invoice numbers or you can create data tables and add invoice numbers to data tables