Hello Everyone,
I need to process only the current date files from the folder, Below are the sample file names
XYSS_MC_XXX_YYYY_202008031234.csv
XYS_MC_YYYY_202008031234.csv
XsS_MC_YYYY_202008011234.csv
any idea pls - Thanks
Hello Everyone,
I need to process only the current date files from the folder, Below are the sample file names
XYSS_MC_XXX_YYYY_202008031234.csv
XYS_MC_YYYY_202008031234.csv
XsS_MC_YYYY_202008011234.csv
any idea pls - Thanks
Hi @Fresher
Refer the below thread that will help you to solve your query :-
Also another way is der as below :-
String filePaths = Directory.GetFiles(path)
For item in filePaths
item.Contains(DateTime.Now.ToString(“yyyyMMdd”))
Mark as solution and like it if this helps you
Happy Automation
Best Regards
Er Pratik Wavhal
@Pratik_Wavhal -Thank you
Purpose : in a folder i need to take only the files with current date and need to add them in array of string for next process, but am getting below error when i fix the for each Type argument as string
if i convert the for each Type argument as object am getting below error
@Fresher You can do so with a Single Linq Query :
FilePaths = Directory.GetFiles(path).ToArray
TodaysFilePaths = FilePaths.Where(Function(x)x.Contains(Now.ToString(“yyyyMMdd”))).ToArray
Where FilePaths and TodaysFilePaths are Array Of String types
Hi @Fresher
So while you are converting Type Argument as object for ForEach Activity then do as below :-
item.ToString.Contains(DateTime.Now.ToString(“yyyyMMdd”))
I forget to mention above der only
Mark as solution and like it if this helps you
Happy Automation
Best Regards
Er Pratik Wavhal
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.