Search Text in .txt then send Mail

Ivana_Jenny

  • Joined: Aug 26, 2011
  • Posts: 19

Mon 8/29/2011 - 8:15

Hi everybody,

 

I want to search this text "RESTORE DATABASE successfully processed" in this file: "Test.txt" and if this text would be found in the .txt then WinAutomation should send an E-Mail...

 

 

Can someone help me, how i could search in a file for an especially text?

 

Best regards,

#1

Samantha

  • Joined: Apr 23, 2010
  • Posts: 2333

Mon 8/29/2011 - 10:49

Hi Ivana, Welcome to our Forum! You would need to use the following actions: >>> Read Text from File "test.txt" --> %FileContents% >>> If %FileContents% contains "RESTORE DATABASE successfully processed" >>>>> Send Email --> Text found! >>> End If Hope this makes sense, please let us know if you need any assistance implementing the above mentioned solution. :) Samantha

#2

Ivana_Jenny

  • Joined: Aug 26, 2011
  • Posts: 19

Mon 8/29/2011 - 10:56

Hi Samantha

 

Thank you for the answer.

 

In the meantime I've found a solution.

 

Action1:   Read Text From File

Action2:   Parse Text  (Varible: %TextFound%)

Action3:   If %TextFound% <> -1 then

Action4:   Send Mail

                End if

 

According to my tests it worked. Do you See a mistake in my reasoning?

 

THANKS ! 

#3

Samantha

  • Joined: Apr 23, 2010
  • Posts: 2333

Mon 8/29/2011 - 11:53

That's fine! It's a more complex approach, but it will give you the same result :) Samantha

#4

Ivana_Jenny

  • Joined: Aug 26, 2011
  • Posts: 19

Mon 8/29/2011 - 13:03

Very good,

 

Thank u so much!!!!! :)

 

 

Thread could be -closed-

#5
Not a member yet? Register

Copyright 2013 - Softomotive Ltd