jamesmishra/mysqldump-to-csv

Perhaps documentation on how to name the file

nareshshah139 opened this issue · 3 comments

Documentation on how the output is stored would be useful

I agree. It appears that the csv format is just output to the terminal? So you would have to pipe it into a csv file upon conversion?

Seems like this has been answered under the Usage section of the README (emphasis is mine):

Just run python mysqldump_to_csv.py followed by the filename of an SQL file. You can specify multiple SQL files, and they will all be concatenated into one CSV file. This script can also take in SQL files from standard input, which can be useful for turning a gzipped MySQL dump into a CSV file without uncompressing the MySQL dump.

zcat dumpfile.sql.gz | python mysqldump_to_csv.py

... so please change:

zcat dumpfile.sql.gz | python mysqldump_to_csv.py

to:

zcat dumpfile.sql.gz | python mysqldump_to_csv.py > output.csv

Or if you want to be cool, add a progress bar to your work:

  1. install pv: apt-get install pv
  2. run: pv dumpfile.sql.gz | zcat | python mysqldump_to_csv.py > output.csv