Created
May 5, 2021 18:13
-
-
Save JohnL4/d2694a0771b98ac90ac0fed34e9ebf77 to your computer and use it in GitHub Desktop.
Strip null characters from a file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From https://stackoverflow.com/a/9866769/370611 | |
# (Obviously, make sure you're not dealing with a Unicode file.) | |
foreach ($f in (Get-ChildItem *.log)) { | |
(Get-Content $f) -replace "`0", "" | Set-Content $f | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment