Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CSV output file per table #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ndwhelan
Copy link

@ndwhelan ndwhelan commented Apr 20, 2018

Adding a feature to allow specifying an output directory, allowing for each table to have its rows in its own file.

Adds optional first parameter --out-dir=. Example usage, which has been added to the README, would be like this:

zcat dumbfile.sql.gz | python mysqldump_to_csv.py --out-dir=./output

OR

python mysqldump_to_csv.py --out-dir=./output ./sql/mysql_dump1.sql ./sql/mysql_dump2.sql

So, if the SQL dumps insert data into the tables users and groups, and --out-dir=./output is specified, two files will contain the data, ./output/users.csv and ./output/groups.csv, respectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants