hi,
i have some files in folder…
Exp—
Swiggy MPR Monthly----->09 - Swiggy December-2021
Swiggy Cancel File—> 09-Swiggy Cancellation Working December-2021
Swiggy reconcilation File----> 09 - Swiggy Reconciliation Differences December, 2021
i want to get Swiggy Mpr Monthly File . Can any one help how to get this file ?
hi @Anand_Designer
Getting the filePaths of the files within a directory
within an assign activity
Leftside: your Variable of Datatype: String Array
Rightside: Directory.GetFiles(YourTargedDirectoryPath)
please watch the below video fr your reference
Thanks
Gokul001
(Gokul Balaji)
March 21, 2022, 6:34am
3
HI @Anand_Designer
Use Assign activity
LHS → Variable of Datatype → String Array
RHS → Directory.GetFiles(“FolderPath”,“Swiggy MPR Monthly*”)
Regards
Gokul
i want Swiggy Mpr file only .to send this file to out Argument. this file name will be use in other workflow
Hi @Anand_Designer ,
Use @Gokul001 approach. You will be good.
1 Like
Gokul001
(Gokul Balaji)
March 21, 2022, 6:39am
6
Hi @Anand_Designer
Try this expression above
Regards
Gokul
hi , i used directory and for each loop . getting each file name .
swiggy MPR monthly file format like-- 09 - Swiggy December-2021.
it might be change for every month --For exp if January come…
10 - Swiggy January -2022.
i want to get this file name dynamically .
i used this condtion but i am not getting exact file name. getting other file name
Gokul001
(Gokul Balaji)
March 21, 2022, 6:48am
8
HI @Anand_Designer
Can you share the exact input file name here
Regards
Gokul
Swiggy MPR Monthly File-----------------> 09 - Swiggy December-2021
Hi @Anand_Designer
if file name changes dynamically with respect to month
then in If condition you can use like this
item.tostring.trim.contains(“Swiggy”+" "+DateTime.Now.ToString(“MMMM”))
Thanks
Gokul001
(Gokul Balaji)
March 21, 2022, 6:54am
11
Hi @Anand_Designer
Try this expression
Directory.GetFiles("Your folderpath","Swiggy MPR Monthly File-----------------"+DateTime.Now.ToString("dd")+" - Swiggy "+DateTime.Now.ToString("MMMM-yyyy"))
Alternative based on the workflow
item.Tostring.Trim.Contains(“Swiggy ”+Now.ToString(“MMMM”))
Regards
Gokul
How to add -2 months this syntax ?
Gokul001
(Gokul Balaji)
March 21, 2022, 7:46am
13
Hi @Anand_Designer
Try this expression
DateTime.Now.AddMonth(-2).Tostring("MMMM")
Regards
Gokul
Gokul001
(Gokul Balaji)
March 21, 2022, 7:47am
14
HI @Anand_Designer
item.Tostring.Trim.Contains(“Swiggy ”+Now.AddMonth(-2).ToString(“MMMM”))
Regards
Gokul
1 Like
ppr
(Peter Preuss)
March 21, 2022, 9:34am
15
we can setup a regex pattern like:
And if a more detail date check is needed we can rely to the groups:
for further evaluations
As an alternate:
If pattern is reliable then we can generate the string for the month of interest and use it for the file retrieval
1 Like
Thank you for given solution . its working fine…
system
(system)
Closed
March 24, 2022, 12:06pm
18
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.