Created
February 14, 2022 09:43
-
-
Save dotancohen/8782216c9e85e43e4c7b0f6f73da1315 to your computer and use it in GitHub Desktop.
Get most common column names from SQL dump file.
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
grep -P "^\s+\`" foo.sql | \ | |
sed -E 's/\([0-9]*/(/' | \ | |
awk '{print $1 "\t" $2}' | \ | |
sort | \ | |
uniq -c | \ | |
sort -n -r > db-common-column-names | |
# 300 MiB SQL file: 0.4 seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment