how to remove all the even and odd numbers?
How can I do this? Someone please help to achieve this.
Welcome to forums
Can you share what output you want?
i want to write even numbers data in one excel sheet and odd number data in one excel and send the data through two separate emails
Use Read Range activity->which output your excel sheet as Datatable, Eg: DtSheet
Now Create Evendt and Odddt variables as System.Data.DataTable Type
Now use Assign and write as below
EvenDt = DtSheet.AsEnumerable().Where(function(x) Cdbl(x(“Register No”)) Mod 2 = 0).ToList.CopyToDatatable
OddDt = DtSheet.AsEnumerable().Where(function(x) Cdbl(x(“Register No”)) Mod 2 <> 0).ToList.CopyToDatatable
Check below for your reference
Use Write Range activity to and write in the sheets by using the datatables
Hope this may help you
Thank you it’s working much appreciated your support.
Can u please explain me this, it would be very helpful: DtSheet.AsEnumerable().Where(function(x) Cdbl(x(“Register No”)) Mod 2 = 0).ToList.CopyToDatatable
It’s a linq function where It will filter the value of Register No Mod 2 = 0
For Mod to understand, Please refer below
Mark as solution if this helps you
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.