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: File Rename
Topic Summary: Not getting expected results when I attempt to rename a file.
Created On: 02/07/2018 01:06 PM
Status: Read Only
Linear : Threading : Single : Branch
 File Rename   - JochenIdeker - 02/07/2018 01:06 PM  
 File Rename   - Ricardo Castaneda - 02/08/2018 03:35 PM  
 File Rename   - JochenIdeker - 02/09/2018 08:00 AM  
 File Rename   - Ricardo Castaneda - 02/12/2018 11:17 AM  
 File Rename   - JochenIdeker - 02/12/2018 11:22 AM  
 File Rename   - Justin Aucoin - 02/14/2018 08:38 AM  
 File Rename   - JochenIdeker - 02/15/2018 08:36 AM  
 File Rename   - Justin Aucoin - 03/12/2018 08:34 AM  
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by JochenIdeker, on Thursday, February 15, 2018 8:36 AM

Answer:
Thank you for the explanation and work around.
 02/07/2018 01:06 PM
User is offline View Users Profile Print this message

Author Icon
JochenIdeker
Student (5-19 posts)

Posts: 15
Joined: 11/07/2014

I am having some trouble with renaming a file. File available is called RESULT_0001405712_Success20180205-082429-710.txt

The expected result is to rename the file RESULT_1405712_Success20180205-082429-710.txt

I will have to rename files daily.

My code for the step that renames the file is
<AMFILESYSTEM ACTIVITY="rename" AM_ERRORS="28033" AM_ERROREXCLUDE="YES" SOURCE="\\automatetest\d$\Inetpub\ftproot\Internal\Medline\RESULT_0001405712*.*" DEST="\\automatetest\d$\Inetpub\ftproot\Internal\Medline\DM\RESULT_1405712*.*" OVERWRITE="YES" ISNEWER="YES" />

The file name after the step has ran ends up being
RESULT_1405712712_Success20180205-082429-710.txt

You can see that the leading zeros have been removed in the first group of numbers, but 712 was added on.

Thanks for looking at this conundrum.

 Category Survey
 02/08/2018 03:35 PM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hello,

Will the end of the file always be the same? ( _Success20180205-082429-710.txt )

 Category Survey
AutoMate BPA Server 10 version:
Windows version:


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
 02/09/2018 08:00 AM
User is offline View Users Profile Print this message

Author Icon
JochenIdeker
Student (5-19 posts)

Posts: 15
Joined: 11/07/2014

The end of the file will not be changed. Expected daily file name will change.

 Category Survey
 02/12/2018 11:17 AM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hello,

Just to be clear the end of the file name is -082429-710.txt?

 Category Survey
AutoMate BPA Server 10 version:
Windows version:


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
 02/12/2018 11:22 AM
User is offline View Users Profile Print this message

Author Icon
JochenIdeker
Student (5-19 posts)

Posts: 15
Joined: 11/07/2014

The unchanged file name is RESULT_0001405712_Success20180205-082429-710.txt
The expected result is RESULT_1405712_Success20180205-082429-710.txt
Only thing that will need to change with the file name is to remove the first three zeros.
The file is expected on a daily basis. It is uncertain on when the file is delivered tho.

To answer your question, yes, that is the end of the file name.

 Category Survey
 02/14/2018 08:38 AM
User is offline View Users Profile Print this message

Author Icon
Justin Aucoin
HelpSystems

Posts: 360
Joined: 02/15/2016

Hi Jochen,

We have identified an issue with the filename actions when using the wildcard as part of the filename. The file will keep the same overall file length, by adding the same number of characters as were removed. This issue will be submitted as a bug and the forum thread will be referenced so that you will be notified once a release is available that addresses the issue.

Below is a workaround that will first check if the file(s) starting with \\automatetest\d$\Inetpub\ftproot\Internal\Medline\RESULT_0001405712*.* exists, and if so populate it a dataset. The dataset will then be looped and a replace text action will be used to remove the desired characters from the file path. The variable will then be used for the file rename action. This method will work for multiple files as well as allowing you to easily schedule the task.

 Category Survey
AutoMate BPA Server 10 version:
Windows version:



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


-------------------------

Justin Aucoin | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
 02/15/2018 08:36 AM
User is offline View Users Profile Print this message

Author Icon
JochenIdeker
Student (5-19 posts)

Posts: 15
Joined: 11/07/2014

Answer Answer
Thank you for the explanation and work around.

 Category Survey
 03/12/2018 08:34 AM
User is offline View Users Profile Print this message

Author Icon
Justin Aucoin
HelpSystems

Posts: 360
Joined: 02/15/2016

Hi Jochen,

We apologize for the delay regarding this issue.

This issue has been verified and assigned a bug number #23921. We hope to correct this issue in an upcoming release of the software. You will be notified when the solution is available via email.

Please let us know if you have any questions or concerns.

Thank you for your help and patience.

 Category Survey
AutoMate BPA Server 10 version:
Windows version:


-------------------------

Justin Aucoin | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
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 426 guests browsing this forum, which makes a total of 426 users using this forum.

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

Sitemap Network Automation Software Blog