Created
July 17, 2018 03:00
-
-
Save yuq-1s/0d0448c20256b2b079cbe982f201ce03 to your computer and use it in GitHub Desktop.
eliminate all empty lines of all python files in a directory in powershell
This file contains 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
Get-ChildItem -path "C:\path\to\my\directory" -recurse -Include *.py | | |
ForEach-Object { | |
(gc $_.FullName) | ? {$_.trim() -ne ""} | Set-Content $_.FullName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment