Read the data as per the date and write that data in output

I have excel it have much of data what my problem is read, only today data and store that data in output by using filter data table, please help me thanks

Can you please provide a screenshot of the excel? as if there is a column containing the date you can use an IF statement

Hi @Aregala_Yedukondalu

  1. Use Read range activity → Store it in DT

  2. Use Filter Data Table

image

  1. Use Write Range activity

image

Regards
Gokul

i tried this but it not writing the data in the excel

Ok
filter data sample

Hi @Aregala_Yedukondalu

How about this expression?

ExtractDataTable = DtInput.AsEnumerable.Where(Function(r) r("Column Name").ToString.Contains(DateTime.Now.ToString("dd-MM-yyyy"))).CopyToDataTable

Regards
Gokul

Where i have to write this

Hi @Aregala_Yedukondalu

You Assing activity and

LHS → DtOutput → Variable type is Datatable

RHS → DtInput.AsEnumerable.Where(Function(r) r(“Column Name”).ToString.Contains(DateTime.Now.ToString(“dd-MM-yyyy”))).CopyToDataTable

Regards
Gokul

i tried this is also not working, i forgot to mention one thing, that is i am using C# sorry for this. Thanks…

Hi @Aregala_Yedukondalu ,

Try the below expression & let me know if it helps.
Input_DT.AsEnumerable.Where(Function(x) CDate(x(“date”).ToString(“dd-MM-yyyy”).Equals(Now.ToString(“dd-MM-yyyy”)).CopyToDataTable()

You can reref the below post for more details on the same.

Thanks,
Rohith

1 Like

Thank you for ur help but its not working

Hello @Aregala_Yedukondalu - If possible share a sample input excel

filter data sample

values visual in Excel are not mandatory in the same format within the datatable
In the following FirstAid sheet some analysis techniques are described:
:ambulance: :sos: [FirstAid] Datatable: Debug & Analysis invalid DateTime Strings / String to DateTime Parsing Issues - News / Tutorials - UiPath Community Forum

Just run it and let us know the result / some outputs from the immediate panel.

Once the format / values within the datatable are cleared we can work further on the filter part

filter data sample

keep in mind that this data will not have todays (11th Aug 2022) dates. So filter result is empty

sorry @ppr that is old excel, i will post another excel please look into that

no problem with the old excel. Just do the analysis as described in the FirstAid and let us know the results

filter data sample1
I tried first those all but i am facing issues, and i am using c#

no problem as you can just use YourDataTableVar within the immediate panel and get insights to the content.