title: Powershell: Return the second line of a Search only
body: <p>I'm trying to return the result of the second line of a search I'm performing on a txt file.
  the data is in the format of </p>
  
  <pre><code>Readings       : \\Server1\memory\available mbytes :
                   2107
  </code></pre>
  
  <p>I want to get 2107 only.
  This is what I have so far:</p>
  
  <pre><code>$file = "D:\PerfTest.txt" # import data
  $data = gc $file
  $RAM = $Data | Select-String -Pattern "available mbytes :" | ForEach-Object -Context 1
  </code></pre>
  
  <p>but it gives me the following:</p>
  
  <pre><code>Readings       : \\Server1\memory\available mbytes :
                    2107
  </code></pre>
  
  <p>But I want to get the figure only. Any help please?</p>
  
  <p>thanks</p>
  
  <p>Just to add to the above, if I use</p>
  
  <pre><code>$RAM = $Data | Select-String -Pattern "available mbytes :" -Context 1 | Foreach {if ($_ -match '(\d+)$') {$matches[1]}}
  </code></pre>
  
  <p>it returns whole numbers and not decimals. so anything with a decimal come out 78125 instead of 0.78125</p>