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: Script Fails When Looping Files
Topic Summary: Script works fine on single file but not when looping files.
Created On: 08/05/2016 12:48 PM
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.
 08/05/2016 12:48 PM
User is offline View Users Profile Print this message

Author Icon
ErikLundstrom
Journeyman (50-99)

Posts: 79
Joined: 09/12/2006

The attached script works first uses the name of a single file ("SomeFile.PART01.RAR"), creates a substring of the the last 6 characters and then searches for "1.rar". That works; "1.rar" is found.

However, when the same thing is done by looping the files in a folder (containing "SomeFile.PART01.RAR"), "1.rar" is not found!?

Very strange!??



 Category Survey
AutoMate 9 version: 9.0.5
Windows version: Windows 7



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
 08/05/2016 12:53 PM
User is offline View Users Profile Print this message

Author Icon
ErikLundstrom
Journeyman (50-99)

Posts: 79
Joined: 09/12/2006

If I modify the script to not find the last 6 characters, but instead search for 1.rar in the whole filename; looping works fine.

 Category Survey
AutoMate 9 version: 9.0.5
Windows version: Windows 7



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

Author Icon
Justin Aucoin
HelpSystems

Posts: 360
Joined: 02/15/2016

Hi Erik,

After reviewing the two sets of steps provided, I did notice an issue in the first set of steps. On the If text contains step during the loop, theFileNameLast6 variable is entered with percent signs. This means that the if statement if evalutating theFileNameLast6 text for 1.rar. If you add the % before and after to it, %theFileNameLast6%, then it will be able to pull the variable's value and work as intended.

 Category Survey
AutoMate 9 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 1375 guests browsing this forum, which makes a total of 1375 users using this forum.

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

Sitemap Network Automation Software Blog