title: python search a text file for a string and add the value to a variable
body: <p>I have a text file like this</p>
  
  <pre><code>PC Name : Sarah , IP : x.x.x.x
  ID : AC:AC LP
  PC Name : Moh, IP : x.x.x.x
  ID : AC:AC LP
  </code></pre>
  
  <p>I want to SEARCH UP "from the end of the file and up" to find the FIRST Match of the string "AC:AC LP"
  then I want to copy the ip in the previous line and add it to a new variable named ip</p>
  
  <p>i searched for codes but they all use normal search and copy the same string , could you help please</p>