Skip to content

Instantly share code, notes, and snippets.

@SteadBytes
Last active July 12, 2018 11:13
Show Gist options
  • Save SteadBytes/7ac62ca95916c1622facdd07fb3cfdd1 to your computer and use it in GitHub Desktop.
Save SteadBytes/7ac62ca95916c1622facdd07fb3cfdd1 to your computer and use it in GitHub Desktop.
Convert 2->4 space indentation in files

Convert 2->4 Space Indentation In place

Converts all .py files from 2->4 space indentation

find ./ -iname "*.py" -type f -exec perl -i -pe's{^((?: {2})*)}{" " x (4*length($1)/2)}e' {} +

Change -iname "*.py" to match other file types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment