Skip to content

Instantly share code, notes, and snippets.

@0x0ade
Last active August 29, 2015 14:27
Show Gist options
  • Save 0x0ade/c35a568afe9673639e2f to your computer and use it in GitHub Desktop.
Save 0x0ade/c35a568afe9673639e2f to your computer and use it in GitHub Desktop.
Strips most of the code from the decompiled FEZ content readers, making them easier to parse when automatically creating writers.
#!/bin/bash
for file in *.cs; do
perl -0777 -pi -e 's/(^(.|\n)*\{)|(\ \ )|(existingInstance\.)|((= |)input\.Read)|(\(.*\);)|(\ *return.*;)|(\ *\})|(if(.|\n)*new\ .*\);)//g' $file
perl -0777 -pi -e 's/^\s*\n//gm' $file
mv "$file" "`basename $file .cs`.txt"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment