I’m new with UI-Path. I used Read CSV to transform CSV to DataTable. As a result, all fields are string typed, that does not make it easy to use Filter activity on some dates or amounts.
What is the correct approach ?
- Use another activity that read CSV and provide DataTable with typed fields, maybe with the help of a schema ?
- Using classic CSV activity, and use LinQ to build anonymous types, but I saw the compiler doesnt support it, that and other things as let or tuples (probably compiler options and scope)
- Using classic CSV activity, and use LinQ to transform DataRow to a strong type I defined in a custom .Net library i wrote and import ?
- Using Excel to import CSV and hope the typing will be done at “opening time”. (but I dont know how to recover DataTable because of the Range I cant predict or now)
- Another way ?
here the code I used to filter and compensate typing lack. not really what i hoped…
(from row in datatableCsv.AsEnumerable()
where DateTime.ParseExact(row.Field(“Date”),“dd/MM/yyyy”,System.Globalization.CultureInfo.CurrentUICulture) >= startDate
&& DateTime.ParseExact(row.Field(“Date”),“dd/MM/yyyy”,System.Globalization.CultureInfo.CurrentUICulture) < endDate.AddDays(1)
Thank you for your help