Last active
June 25, 2018 15:46
-
-
Save dossy/13d826e273f53a74de45d505846701a8 to your computer and use it in GitHub Desktop.
split mysqldump with gawk
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
gawk 'BEGIN { F="_"; } match($0, /^-- (Table|Temporary table) structure for (table|view) `(.*)`/, m) { close(F ".sql"); F=m[3]; } { print $0 > F ".sql"; }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment