title: Powershell: Find/Replace pattern of ASCII control characters
body: <p>I'm trying to write a script to search the contents of a file, and when it comes across a grouping of ASCII control characters, to insert a CR/LF.</p>
  
  <p>The pattern of characters I would like to replace are <strong>[ETX][NUL][STX][ETX][SOH]</strong></p>
  
  <pre>
      $filenames = @(Get-Childitem "E:\VendorFiles\*")
  
      $CR = @("[char]3 [char]0 [char]2 [char]3 [char]1")
      foreach ($file in $filenames) {$outfile = "$file" + ".txt"
      Get-Content $file | Foreach-object {
              $_ -replace $CR,"`r`n" `
               -replace [char]3,"|" `
               -replace [char]1,"{" `
               -replace "\\","\\" `
          } | Set-Content -encoding "UTF8" $outfile}
  </pre>