Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Loop folder and move specific folders
Topic Summary:
Created On: 09/26/2013 02:24 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 09/26/2013 02:24 AM
User is offline View Users Profile Print this message

Author Icon
BasKwantes
Student (5-19 posts)

Posts: 11
Joined: 02/24/2011

Hello,

I am trying to create a task which loops through a certain folder and then needs to move -specific- subfolders to another location.

For example: I want to loop folder "C:\Root" and want to move some subfolders (and files in the subfolders) to another location. The only problem is that the subfolder which need to be moved, only need to be moved when they are older than 3 days AND contain a specific datevariable in the folder name. There are other subfolders in this "Root" folder which do not have be moved.

Below is a piece of code, but I'm stuck on how to deal with the datevariable.

If someone can help me with this I am very thankfull.

Kind regards,
Bas

Automate version 8.0.9.0


 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
 09/26/2013 04:05 AM
User is offline View Users Profile Print this message

Author Icon
SarathiKamaraj
Artisan (200-499)

Posts: 244
Joined: 07/30/2012

Hello Bas,

I have a situation like yours. I have given my code.

 

This will take folders less than 3 days old and have yyyy-mm-dd in the folder name and move it to some other folder.

 

This regex will have identify yyyy-mm-dd(the seperator can be / or . also)

 

You can modify this to your requirement. 



 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------
Thanks,
Sara

Edited: 09/26/2013 at 04:17 AM by SarathiKamaraj
 09/26/2013 04:16 AM
User is offline View Users Profile Print this message

Author Icon
SarathiKamaraj
Artisan (200-499)

Posts: 244
Joined: 07/30/2012

Also if your file has datevariable in the format yyyymmdd then use the below code

 

 



 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------
Thanks,
Sara
 09/26/2013 04:37 AM
User is offline View Users Profile Print this message

Author Icon
BasKwantes
Student (5-19 posts)

Posts: 11
Joined: 02/24/2011

Hi Sara,

thank you (again) for the code. It does exactly what i need.
Except for the piece of code below, Automate does not recognize this...
Maybe you have a newer version?



 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
 09/26/2013 04:54 AM
User is offline View Users Profile Print this message

Author Icon
SarathiKamaraj
Artisan (200-499)

Posts: 244
Joined: 07/30/2012

I use BPA Server 9. I am not sure if this function is available in Automate 8

 

It is just to move the folder and merge it if it is already avaialble and replace the files in the folder if it is already exists.

 

You can write the equivalant code in Automate 8.

 

Good to know it helped....



 Category Survey


-------------------------
Thanks,
Sara
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1288 guests browsing this forum, which makes a total of 1288 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog