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: If Text Help
Topic Summary: If Text Help
Created On: 09/03/2013 05:35 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.
 09/03/2013 05:35 AM
User is offline View Users Profile Print this message

Author Icon
DaveAustin
Student (5-19 posts)

Posts: 14
Joined: 05/08/2013

Looking for the best way to do this... pardon my ignorance.  I have a text document that updates every five minutes with new data.  I'd like to quickly search the text document and see if one of these five values is in it.  If it is, then do nothing.. if none of the values are there then I want it to send me an email.

 

So, I'm reading the file and storing the data in a variable.

 

Then, I'm simply doing If text %variable% doesn't contain VALUE1 Else If text %variable% doesn't include VALUE2.. if text%variable% doesn't include VALUE3 etc etc ELSE Send Email.

 

Is there a cleaner way to do this?  Maybe through loops or something?



 Category Survey
 09/04/2013 02:09 PM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hi Dave,

How big is the file in question?

Do you have sample we can take a look at?

 Category Survey


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

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
 09/04/2013 09:18 PM
User is offline View Users Profile Print this message

Author Icon
JeanDelfosse
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

Dave,
if...else's look like a nice way.
If the text is big (above 10k chars), it better be made in a basic script, or in a single expression.
In later versions of AM, "IF text contains" with regular expression like value1|value2|value3 could be considered but it does not work in AM6

 Category Survey
AutoMate 6 version:
Windows version:


-------------------------
Jean Delfosse - Automate Beta Tester
Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4
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 918 guests browsing this forum, which makes a total of 918 users using this forum.

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

Sitemap Network Automation Software Blog