Skip to content

Instantly share code, notes, and snippets.

@andreyuhai
Created June 20, 2019 10:01
Show Gist options
  • Save andreyuhai/57e52e6b71aafe24109cf45f285c0621 to your computer and use it in GitHub Desktop.
Save andreyuhai/57e52e6b71aafe24109cf45f285c0621 to your computer and use it in GitHub Desktop.

Here is a way to import table content into a csv file that I've found on SO.

mysql --user=wibble --password wobble -B -e "use db; select * from vehicle_categories;" | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > vehicle_categories.csv

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment