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: Capture Filename
Topic Summary:
Created On: 01/13/2014 08:55 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.
 01/13/2014 08:55 AM
User is offline View Users Profile Print this message

Author Icon
mcurran
Journeyman (50-99)

Posts: 60
Joined: 01/11/2006

After a long hiatus from Automate, my company is moving back.
We currently have jobs running in version 6. Yeah, I know.
I have installed version 9 to 2 new servers and I'm waaaaiiittng for the security team to set up my firewall rules request. Could take a while.
But, I have a new request to download files and based on the filename, email the file to various customers.

The filenaming convention is wmcb_weddmmyycustnumber.csv
A typical file name is wmcb_we010114012345D.csv
How do I capture the filename and parse out the customer number. In this case 012345
I have tried various methods to no avail. I must be rusty. I have no other jobs performing this type of capture.

Once i have that info...
I need to then perform a lookup to match the customer number and set up the email. I suppose I'll load an Excel document with the information? Or, perhaps build a file on our VMS system and have Automate read the file an match by key.
Thanks.
Mike

 Category Survey
 01/13/2014 09:16 AM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

Hi Mike,

Can you provide a sample listing of more file names? Is the character length the same for all file names? I have attached a sample task that assumes specific character positions and lengths.

 Category Survey
AutoMate 6 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)


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

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
 01/13/2014 10:01 AM
User is offline View Users Profile Print this message

Author Icon
mcurran
Journeyman (50-99)

Posts: 60
Joined: 01/11/2006

I ran that code. And yes, the 6 characters did appear in the window.
I think i mis stated my original question.

I will never know what the file names are until i loop through a directory on our vms syetem. The files change every weekend after I run a batch job.

After that batch job runs I need to loop through the new list of file names on vms, which i am doing, ftp all the files to the local Automate server which i am doing, and email the files based on customer number (varFileName,14,6).

So once the files are on the local Automate server, I loop through that local directory. I need to read each file name and capture the (varFileName,14,6) in a variable so I can use those 6 characters to perform a lookup on another table.
But I am having trouble getting those 6 characters into a variable.

 Category Survey
 01/13/2014 04:11 PM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

Hi Mike,

My task was a sample that loops through a list. You can use the Loop Files action instead which populates a variable with each file name within the folder you are looping through.





 Category Survey
AutoMate 6 version:
Windows version:


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

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
 01/14/2014 07:35 AM
User is offline View Users Profile Print this message

Author Icon
mcurran
Journeyman (50-99)

Posts: 60
Joined: 01/11/2006

Yeah was attempting to use the Loop Files and was having a brain fart.
Settled on this.






 Category Survey
 01/14/2014 07:36 AM
User is offline View Users Profile Print this message

Author Icon
mcurran
Journeyman (50-99)

Posts: 60
Joined: 01/11/2006

See above. Or below, depending...

 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
 01/14/2014 10:55 AM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hi Mike,

Did the code you posted work for you?

 Category Survey


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

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
 01/17/2014 05:30 AM
User is offline View Users Profile Print this message

Author Icon
mcurran
Journeyman (50-99)

Posts: 60
Joined: 01/11/2006

Yes, in Automate 6. Have not tried in version 9.

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

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

Sitemap Network Automation Software Blog