Created
October 3, 2011 15:26
-
-
Save maciej/1259368 to your computer and use it in GitHub Desktop.
Transforms SQL Import script into Java-like entries enum content
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
# TODO replace the magic 57 with an actual match of the prefix | |
perl -pe 's/.{57}('.*')\);$/\1/' entries.txt | tr "[:lower:]" "[:upper:]" | sed "s/'//g" | sed -E 's/([^A-Z])+/_/g' | perl -e '$i = 1; while (<>) {chomp; printf("%s(\"%04d\"),\n", $_, $i); $i = $i + 1}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment