Skip to content

Instantly share code, notes, and snippets.

@ustims
Created July 10, 2013 12:01
Show Gist options
  • Save ustims/5965718 to your computer and use it in GitHub Desktop.
Save ustims/5965718 to your computer and use it in GitHub Desktop.
mysql -h hostName -u userName -p -D dbName -A -B -e "select * from someTable where created > '2013-06-01 00:00' and created < '2013-07-01 00:00';" | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > temp/generated-month-201306.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment