I have an XLSX with many columns and i need to search the one with more than 31 days old and delete it from the Excel, the date have this format (YYYY-MM-DD). maybe LinQ do the trick usin Uipath, but it dosn’t work, how can i do this?
I believe that in your case you would have to bring the data into a datatable and then apply a filter based on the date column and prior to that you would need to convert the string into date and apply the filter later on.
Something like this:
myDt = myDt.Where(Function(x) (DateTime.Now - DateTime.ParseExact(x.Item("ColumnDate").ToString, "yyyy-MM-dd", CultureInfo.InvariantCulture)).Days > 31).ToDataTable
I supose that, i can make that code in an Assign Activity, right?
Easier but longer way
- Use For each row in ExtractedDatatable
- If Convert.todatetime(row(“DateColumn”).tostring)>Today.addDays(31))
Create a data table with the read
Put the for each row i supose right?
Yes you are correct…
Can you make an Example .xaml Please?
This is what i got.
See the attached.
test.xaml (7.6 KB)
You’re the best!!!