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: Search for text in terminal window
Topic Summary:
Created On: 12/18/2016 02:24 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.
 12/18/2016 02:24 PM
User is offline View Users Profile Print this message

Author Icon
RickJohnson
Apprentice (20-49)

Posts: 42
Joined: 12/14/2005

Hi Guys
I get Automate to open a terminal window every hour I have another program running that displays text in about 6 lines it refreshes every 40 seconds. I use Automate to copy a line of text to notepad. The problem is every time the terminal window opens the text that is displayed is not in the same order. The line Im looking for is "The temp is ?"
Is there a way to search for this line and copy it.
Thanks
Rick

 Category Survey
 12/19/2016 02:28 AM
User is offline View Users Profile Print this message

Author Icon
Gijsberth de Ruiter
Artisan (200-499)

Posts: 455
Joined: 03/30/2005

Rick,
Could you post your task. The solution depends on how your read the text, but I'm sure this is possible.

 Category Survey


-------------------------
I am an A-Team Member
 12/19/2016 12:21 PM
User is offline View Users Profile Print this message

Author Icon
RickJohnson
Apprentice (20-49)

Posts: 42
Joined: 12/14/2005

Here you go
Have a look
Thanks

 Category Survey



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



 12/19/2016 02:25 PM
User is offline View Users Profile Print this message

Author Icon
Gijsberth de Ruiter
Artisan (200-499)

Posts: 455
Joined: 03/30/2005

If you after line 8 would safe the file and add the attached code, it should work. (of course adjust the file name)

 Category Survey



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


-------------------------
I am an A-Team Member
 12/20/2016 11:17 AM
User is offline View Users Profile Print this message

Author Icon
RickJohnson
Apprentice (20-49)

Posts: 42
Joined: 12/14/2005

Thanks for the info. I've inserted your code after my line 8. Im not sure how to add a line after my line 8 and the start of yours to save the file. Actually Im not sure what file Im suppose to save.
Any suggestions
Rick

 Category Survey
 12/21/2016 02:27 AM
User is offline View Users Profile Print this message

Author Icon
Gijsberth de Ruiter
Artisan (200-499)

Posts: 455
Joined: 03/30/2005

Rick,
If I understand your code correctly, you open notepad (line 6) and paste your read date into notepad (line 7). If you save that file, my code will read the file and select teh right line for you.

 Category Survey


-------------------------
I am an A-Team Member
 12/21/2016 11:31 AM
User is offline View Users Profile Print this message

Author Icon
RickJohnson
Apprentice (20-49)

Posts: 42
Joined: 12/14/2005

Thanks. Ill give it a try tonight. Just wondering is there a reason that I have to save the Notepad file first. Can I not search for the text before I close notepad
Rick

 Category Survey
 12/22/2016 12:45 AM
User is offline View Users Profile Print this message

Author Icon
Gijsberth de Ruiter
Artisan (200-499)

Posts: 455
Joined: 03/30/2005

I let you save the file as it is easy to search the file for the correct line. It probably can also be done by searching the value of the variable directly, but than I need to know mere about the exact content and characters used,

 Category Survey


-------------------------
I am an A-Team Member
 12/22/2016 10:07 AM
User is offline View Users Profile Print this message

Author Icon
RickJohnson
Apprentice (20-49)

Posts: 42
Joined: 12/14/2005

Sorry Im confused when I copy your code into mine after line 8 its missing information as you can see in the attached screen shot "Code". I dont see VALUE="The temp is 65" /> and VALUE="The temp is" /> When I copy the code to this reply I can see the missing info.
Whats going on.
I have also attached a screen shot of the terminal window "Terminal Window" so you can see the exact line that I need copied. The only thing that would change is the number. Any chance there is a way to search for this line when copied to notepad without saving.
Thanks for your help
Merry Christmas
Rick

 Category Survey



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


Click for full image
Click for larger image

 12/22/2016 12:41 PM
User is offline View Users Profile Print this message

Author Icon
Justin Aucoin
HelpSystems

Posts: 360
Joined: 02/15/2016

Hi Rick,

The steps that Gijsberth posted were created in version 10 and in the case of the IF text contains action, are not compatible with version 9. Attached is a IF text contains step that is compatible with version 9.

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


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

Justin Aucoin | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
 12/28/2016 08:55 AM
User is offline View Users Profile Print this message

Author Icon
RickJohnson
Apprentice (20-49)

Posts: 42
Joined: 12/14/2005

Thanks guys for your help. Ive being trying to do what you suggest over the holidays. My skills at programming are limited.
First thing I changed Line 4 from coping a specific line because it was wrong most of the time anyway to capture the hole screen. Problem is when sending the text to notepad it takes a couple of minutes to complete. While this is not a big problem is there not away around that. In line 3 I can pause the task until it reads "Temperature is X degrees" so it can read the text. Is there no way to copy just the text I want. If not then
Second I cant figure out how to save the notepad file
Rick
Disregard line 7

 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: 12/28/2016 at 09:02 AM by RickJohnson
 12/28/2016 02:57 PM
User is offline View Users Profile Print this message

Author Icon
Justin Aucoin
HelpSystems

Posts: 360
Joined: 02/15/2016

Hi Rick,

The attached code should file your requirements. I removed the run notepad.exe action in favor of a write to file option that will save it directly. I also added a loop list of the variable "yui", based on line, that will look for a line containing "The temperature is" and then read the line after a dialog box.

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


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

Justin Aucoin | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
 12/29/2016 11:10 AM
User is offline View Users Profile Print this message

Author Icon
RickJohnson
Apprentice (20-49)

Posts: 42
Joined: 12/14/2005

Justin thank you very much for your script. Works better then what I had there is only one problem it reads everything instead of just the line with the Temperature. The attached is a screen shot of what it reads. Each time could be a little different depending whent the terminal window is open and where the Arduino is with the sketch its running.
Any ideas
Rick

 Category Survey


Click for full image
Click for larger image

 12/30/2016 01:52 AM
User is offline View Users Profile Print this message

Author Icon
Gijsberth de Ruiter
Artisan (200-499)

Posts: 455
Joined: 03/30/2005

Does the variable vtextloopup match the start of the line you look for? if not, you should correct the value of the variable.

 Category Survey


-------------------------
I am an A-Team Member
 12/31/2016 09:18 AM
User is offline View Users Profile Print this message

Author Icon
RickJohnson
Apprentice (20-49)

Posts: 42
Joined: 12/14/2005

Thanks very much for your help its working great. I didn't notice The infront of Temperature is in the vtextlookup. I dissabled the message box line 11 and I dissabled the line 16 and 17. The script would read the temp then go on and line 17 would read out everything.
Hope everyone has a good New Year.
Thanks again
Rick


 Category Survey
 01/01/2017 08:56 AM
User is offline View Users Profile Print this message

Author Icon
Gijsberth de Ruiter
Artisan (200-499)

Posts: 455
Joined: 03/30/2005

Great,
Happy New Year!

 Category Survey


-------------------------
I am an A-Team Member
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 1113 guests browsing this forum, which makes a total of 1113 users using this forum.

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

Sitemap Network Automation Software Blog