0

I need a CSV from a remote mysql server (so "TO OUTFILE" is not possible) for further processing. The issue is the fields are text that usually contains tabs (\t) so is not possible to use sed or awk to post-process and separate fields as we will end with more columns than expected for some rows.

My first approach reading Mysql manual is:

content=""$(mysql -u my_user -pthepass -h remote.sql.com -D my_db -s -e "${query}" --delimiter="|")

but to no avail. I get tab separated csv.

is there any way avoiding to make a replacement after the data is loaded?

Forge
  • 1,238
  • 1
  • 9
  • 25

0 Answers0