MySQL client out as CSV
If you need to convert mysql-client
output as CSV here is a recipe
alias mysql2csv='sed '\''s/\,/\\,/g;s/\"/\\"/g;s/\t/","/g;s/^/"/;s/$/"/;s/\n//g'\'''
mytsql -e "select * from users" | mysql2csv
comments powered by Disqus