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: Is it possible to extract certain characters from a variable ?
Topic Summary:
Created On: 04/10/2017 07:32 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.
 04/10/2017 07:32 AM
User is offline View Users Profile Print this message

Author Icon
ConTrelos
Apprentice (20-49)

Posts: 44
Joined: 09/01/2013

What I would like to do is extract the last 6 characters of a variables value, and put it into aanother variable.

 

Eg

I have a folder with a bunch of PDFs in it.

Each file is named like this :
    John Smith 2008 $58.30 (file types are hidden)

    Joe Montie Reginald 2009 $60.50

I have a whole list of files I need to work with.

 

I know how to get the information and put it into a variable.  That is easy.
How do I get the last 6 characters of that Variable (eg, Var1) and put that into another variable (varPrice) ?

All prices are under $100.00 so using the last 6 characters would work.
I need to seperate the name from the year, from the value.

Is this even possible with Automate ?

 



 Category Survey
AutoMate 9 version: 9.0.5
Windows version: Windows 7
 04/10/2017 12:50 PM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hello,

You can use the following code to grab the information you need. The 6 in step 3 the "Set Variable" can be adjusted to any number you would like. That grabs the amount of characters you are looking for.

Let us know if that works for you.


 Category Survey



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
 04/10/2017 06:39 PM
User is offline View Users Profile Print this message

Author Icon
ConTrelos
Apprentice (20-49)

Posts: 44
Joined: 09/01/2013

Thank you Ricardo

Worked brilliantly.

 

My only addition to that (in case anyone else is looking for a similar scenario) was to include the following line to remove the price from the rest of the name.

 

It basically replaces the last 6 characters with nothing



 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)
 04/11/2017 09:00 AM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hello,

No problem, thank you for the update.

 Category Survey


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

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
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 1341 guests browsing this forum, which makes a total of 1341 users using this forum.

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

Sitemap Network Automation Software Blog