title: Deleting Special character from a text file
body: <p>I have a text file and I want to remove Special Characters from that file. For example:-
  the entries in the text files </p>
  
  <pre><code>++Mathematics
  --Chemistry
  (Physics)
  $#History)
  %%Geography
  </code></pre>
  
  <p>Now I want to replace all of the special characters from strings in the text file and want the output as:-
  Mathematics
  Chemistry
  Physics
  History
  Geography</p>
  
  <p>I have used the replace command in my powershell script but in spite of replacing the special characters, it is deleting all the values from my text file.</p>
  
  <pre><code>get-content D:\Share\SCCM-Powershell_Commands\edit.txt
  Foreach-object {$_ -replace "\&amp;", "" -replace "\£", "" -replace "\+", "" -replace "\-", "" -replace "\)","" -replace "\(","" -replace "\$","" -replace "\#","" -replace "\*",""}|
  Set-Content D:\Share\SCCM-Powershell_Commands\edit1.txt
  
  get-content D:\Share\SCCM-Powershell_Commands\edit.txt
  </code></pre>
  
  <p>Meanwhile can someone also suggest how to start learning powershell. I am a newbie in powershell and want to learn Powershell scripting.</p>