Created
March 9, 2018 14:02
-
-
Save joostvanveen/8a7e4745bd1f970dc069b760a3501e19 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