I have a folder say Report under which i will have two more folder say 2019_01 and 2018_12 .
Now, in these two folders have some processed report files present.
So, Firstly i have to check if current month folder is there or not ( say month and year is coming from “20-01-2019” after some manipulation) then, check if files are there or not in the present month folder but if no files are there in current month folder then look for the previous month folder ifpresent . And over here again i need to check if files are there in previous month folder or not…
I am stuck over this place … can someone please help me on this.
Get all directories from report folder.
Use for each to get single folder under reports
Now get all files from child folder and check child count is greater than 1
If child count is greater than 0 then retrive back parent folder name.
Give it a try…
I will provide sample code for same…
If you have some sort of folder structure please upload in zip format so that it will be easy for us to evaluate.
Adding more - there are chance that this Report folder can contain other subfolder but we are only concerned with picking present month folder and if no files are present then look for previous month folder. If even not found in previous month then throw business exception[ this exception part please ignore]
@rahatadi
This does not answer to the requirements, as it looks for all the folders by the date of the creation, or it might fetch the folder from somewhere else or generate all the folders at once with some kind of reporting tool.
@md.ahtesham till what loop should the process run? you can have yyyy_MM for as many times as you want.
when do you expect to exit the search loop for previous month folder?
I have not gone through xaml files . I will go through it once I get some time. But @c.ciprian is understanding the scenario is correctly.
@nadim.warsi - At first bot will look for current month folder i.e 2019_01 and then check if file is inside or not …if Found then it will do the rest processing part but if either folder or files are not present then it will try to look for previous month folder(2018_12) and files inside it - if it is found then it will pick the file and do processing but if here also bot is not able to get file then I will throw business exception.
@nadim.warsi - when do you expect to exit the search loop for previous month folder? – I want to exit after previous month.
this is another way of doing same…and no need to specify when this process end
it will find all folders which are in yyyy_MM format and check that contains some files or not.
Hi
I have a mail folder say Inbox1 under which i will have number of subfolders say 01 - Jan, 01-Jan FM, 02 -Feb, 02 - Feb FM, and so on till 12 - Dec and 12 - Dec FM .
Now, in these 24 folders have some processed mails present.
So, I have to move mails of 3 month older month from current month to destination folders say Inbox2 and Inbox 3
Inbox 2 is the destination folder for 01 - Jan kind of folders , i.e., without suffix FM
Inbox 3 is the destination folder for 01 - Jan FM, i.e., with suffix FM
And the subfolders under inbox 2 and inbox needs to be created as per inbox 1 with month and year values.
I am stuck over this place … can someone please help me on this.
Regards,
Chandni