title: Ansible parse stdout_lines to verify values of a particular item
body: <p>I am using ansible to write some tests. I have to parse through the output of a command (stdout_lines) and verify the information corresponding to a particular name. The stdout_lines looks like the following. </p>
  
  <p>The output is obtained from a cli command executed in bash. </p>
  
  <pre><code>"stdout_lines": [
          "----------------------------------------------------------------------------------------",
          "|       Name               |      Count   |  Score | State|",
          "----------------------------------------------------------------------------------------",
          "| Jake                     |             5| 10     |   CA |",
          "| Mike                     |             3| 15     |   AR |",
          "----------------------------------------------------------------------------------------",
          "|Total Scores: 2                                          |",
          "----------------------------------------------------------------------------------------"
      ]
  </code></pre>
  
  <p>I would like to parse over the stdout_lines and find out the information related to, say for example 'Jake', and then verify if the the corresponding values are correct. </p>
  
  <p>If in Python, I would Split the string into a list, find list-element that has Jake at [0] index and verify the other elements in it. I tried looking up but couldnot stumble upon anything that could help me. Can anyone throw some light on how to do this. Appreciate your help. </p>
  
  <p>Thanks in advance, </p>