Hello,
Im trying to read from Excel but i need only last 500 from few sheets
The file has 20 000 row i dont want to read them all.
And there anyway to check newly added rows ! we so pick only the new once’s!
Best regards
Hello,
Im trying to read from Excel but i need only last 500 from few sheets
The file has 20 000 row i dont want to read them all.
And there anyway to check newly added rows ! we so pick only the new once’s!
Best regards
you cannot guess without having old data on which is new
but if you need only last 500 then in modern activities can use this in read range
"A" + (Excel.Sheet("SheetName").RowCount+1).ToString
cheers
Hi @Hazem_Saleh
Try this
dt.AsEnumerable().Skip(Math.Max(0, dt.Rows.Count - 500)).CopyToDataTable()
Regards,
If there is definition or fixed logic how to identify the new once’s then this is feasible else NO option. [Automations are not that smart yet ]
Read Range - workbook is your best shot but again couldn’t assure you will get latest data only.
Thanks,
Ashok
Thanks im trying
dT.AsEnumerable().Skip(Math.Max(0, dt.Rows.Count - 500)).CopyToDataTable();
but i have this error “Main.xaml: CS0012: The type ‘IXmlSerializable’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Xml.ReaderWriter, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’.”
and i cant find it anywhere to add it in the references.
If you are going to get 500 rows after reading the whole file then, you are already reading all 20k plus rows and then again spending time on getting 500.
You should be using the logic to read 500 rows in first place.
Thanks,
Ashok
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.