title: Format results in table
body: <p>My script below searches for a specific part number (459279) recursively through a number of txt files.</p>
  
  <pre><code>set-location C:\Users\admin\Desktop\PartNumbers\
  $exclude = @('PartNumbers.txt','*.ps1')
  $Line = [Environment]::NewLine
  Get-ChildItem -Recurse -Exclude $exclude | select-string 459279 | group count | Format-Table -Wrap -AutoSize -Property Count,
  @{Expression={$_.Group | foreach { $_.filename} | Foreach {"$_$Line"} }; Name="Filename"},
  @{Expression={$_.Group | foreach {$_.LineNumber} | Foreach {"$_$Line"} }; Name="LineNumbers"} | Out-File 459279Results.txt
  </code></pre>
  
  <p>My Results are:</p>
  
  <pre><code>Count Filename                           LineNumbers
  ----- --------                           -----------
      2 {Customer1.txt                     {2         
        , Customer2.txt                    , 3        
        }                                  }          
  </code></pre>
  
  <p>My ideal results would be if this is possible:</p>
  
  <pre><code>Part Number: 459279
  Count: 2
  
  Filename                           LineNumbers
  --------                           -----------
  Customer1.txt                      2         
  Customer2.txt                      3        
  </code></pre>
  
  <p>I have manually retrieved the part number '459279' from "PartNumbers.txt" and searched for it using the script.</p>
  
  <p>I cannot seem to remove/replace the braces and commas to present a clean list.</p>
  
  <p>What I hope to eventually do is to recursively search through "PartNumbers.txt" and produce a report with each part number appended to the next in the style mentioned above.</p>
  
  <p>PartNumbers.txt is formatted:</p>
  
  <pre><code>895725
  939058
  163485
  459279
  498573
  </code></pre>
  
  <p>Customer*.txt are formatted:</p>
  
  <pre><code>163485
  459279
  498573
  </code></pre>