-
-
Save phillipwilhelm/d2145f16c8b0a49703f11a11fe940f27 to your computer and use it in GitHub Desktop.
Split large SQL files into separate files for each table
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
## Split large SQL files into separate files for each table if every tabel starts with a 'DROP TABLE IF EXISTS' statement | |
csplit -k $PWD/filename.sql '/^DROP TABLE IF EXISTS .*/' '{900}' | |
## Split large SQL files into separate files for each table if every tabel starts with a 'CREATE TABLE' statement | |
csplit -k $PWD/filename.sql '/^CREATE TABLE .*/' '{900}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment