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: Join string literal with contents of variable
Topic Summary:
Created On: 01/05/2018 03:33 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.
 01/05/2018 03:33 PM
User is offline View Users Profile Print this message

Author Icon
CurtisReynolds
n00b (>6 posts)

Posts: 1
Joined: 01/05/2018

Hi all... sorry in advance if this has been asked...and answered a thousand times already. I didn't find it though, so I'm asking.

I am extracting some information from one string storing it in %variablefoldername%, and need to use that information to form part of a file path. I have a leading literal string, then the contents of the variable, then another literal, that need to be joined to a single string.

What I have is:

"\\unc\folder1\folder2\"

%variablefoldername%

"\lastfolder"

I need to join them to a single string like:
"\\unc\folder1\folder2\<variablefoldername>\lastfolder"

Any help would be GREATLY appreciated!!

Thanks!!!

 Category Survey
AutoMate BPA Server 7 version:
Windows version:
 01/08/2018 11:44 AM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hello,

You can concatenate variables using "&". I have added sample code to this post.

i.e.
%varLiteral1 & varNew & varLiteral2%

Let us know if this works for you.

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


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

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

Author Icon
InformationTechnology
Student (5-19 posts)

Posts: 13
Joined: 11/30/2006

Hello. Does that work for writing out a file? I have code like this and it keeps saying invalid AML (near the end of the line)

 Category Survey



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


Edited: 07/12/2018 at 10:39 AM by AutoMate Discussion Moderator
 07/12/2018 01:26 PM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

What version of Automate are you running? The .aml code you have provided will not work in v7.

 Category Survey


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

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

Author Icon
InformationTechnology
Student (5-19 posts)

Posts: 13
Joined: 11/30/2006

11.0.6.11, sorry

 Category Survey
 07/13/2018 09:04 AM
User is offline View Users Profile Print this message

Author Icon
Hamid Noorbakhsh
HelpSystems

Posts: 454
Joined: 07/29/2008

When editing AML directly, one has to be careful, please paste your text into the editor rather than editing AML directly when not sure and it will work. All XML special characters need to be escaped, so try the following and it will work.

Good luck.

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


-------------------------
Thank you for choosing AutoMate

Hamid Noorbakhsh | Senior Software Engineer
AutoMate | A Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700

Edited: 07/13/2018 at 09:20 AM by Hamid Noorbakhsh
 07/13/2018 10:29 AM
User is offline View Users Profile Print this message

Author Icon
InformationTechnology
Student (5-19 posts)

Posts: 13
Joined: 11/30/2006

That works! Thank you, I appreciate it.

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

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

Sitemap Network Automation Software Blog