Skip to content

Instantly share code, notes, and snippets.

@janmejai
Created August 15, 2016 17:41
Show Gist options
  • Save janmejai/2b62f04fc4408fe0358fe99ab7853501 to your computer and use it in GitHub Desktop.
Save janmejai/2b62f04fc4408fe0358fe99ab7853501 to your computer and use it in GitHub Desktop.
mysql -u username -p databasename -B -e "select * from tablename;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > tablename.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment