Remove Pipe-Delimiters from Text File

This topic contains 2 replies, has 2 voices, and was last updated by  foncesa john 3 years, 5 months ago.

  • Author
  • #20060

    foncesa john


    I have created a script to insert the pipe-delimiters in text file, the purpose for that is search in text file which is successful, now i want to restore it back to its original text file with removing all pipe delimiters inserted.
    Is there a simple way to remove all the pipe delimiters in a single go.

    Thanks in advance.

  • #20062

    Dave Wyatt

    Something like this should do the trick:

    (Get-Content .\file.txt) -replace '\|' | Set-Content .\file.txt
  • #20063

    foncesa john


    Thanks, so simply and faster, Amazing.

    Thanks a lot.

You must be logged in to reply to this topic.