Skip to content

Instantly share code, notes, and snippets.

@yuq-1s
Created July 17, 2018 03:00
Show Gist options
  • Save yuq-1s/0d0448c20256b2b079cbe982f201ce03 to your computer and use it in GitHub Desktop.
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
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