The attached script can be used to migrate data out of a sqldump and into csv and xls for further analysis or ETL’ing. The name of each table is used to create a separate csv file (e.g. table1.csv) and an xls representation of each table is put into a workbook in a spreadsheet.
The script requires Python 3.7. So if you’re on a Mac you might need to install that. Here, we use Homebrew to do so:
brew install python3
Then you’d need to install the specific mods:
python3 -m pip install pandas
python3 -m pip install openpyxl
The command is then run as follows:
python3 sqlcsvxlsexport.py <sql dump file> <target directory>
The script is accessible here: