title: how to convert text to csv file which having delimiter '|' in powershell
body: <p>Code:</p>
  <pre><code>$file= Get-Content &quot;C:\Users\phm4\Desktop\source\status.txt&quot; | select -first 18
  
  $new=$file | select -Skip 12
  $nospace=($new)-replace '\s' 
  $nospace | Out-File new1.txt
  
  import-csv new1.txt -Delimiter &quot;|&quot; | export-csv csvfile.csv
  </code></pre>
  <p>Sample data:</p>
  <pre class="lang-none prettyprint-override"><code>1|10.9.7.73|-A--|0|505k|505k|2.4T/52.7T(5%)|L3:1.5T
  2|10.9.7.74|OK|0|608k|608k|2.4T/52.7T(5%)|L3:1.5T
  3|10.9.7.75|OK|0|626k|626k|2.4T/52.7T(5%)|L3:1.5T
  4|10.9.7.76|OK|0|0|0|2.4T/52.7T(5%)|L3:1.5T
  5|10.9.7.77|OK|0|0|0|2.4T/52.7T(5%)|L3:1.5T
  6|10.9.7.78|OK|0|398k|398k|2.4T/52.7T(5%)|L3:1.5T
  </code></pre>