Is it possible to modify the string used to delimit output columns in command line MySQL query results? E.g. could I change | to ! or ||?

link|improve this question

75% accept rate
feedback

1 Answer

Yes. From mysql documentation:

[mysql commandline] When used interactively, query results are presented in an ASCII-table format. When used noninteractively (for example, as a filter), the result is presented in tab-separated format. The output format can be changed using command options.

Thus, you can pipe mysql commandlines output to sed and change tabs to whatever you want.

see sed doc: http://www.grymoire.com/Unix/Sed.html#uh-6

also there seems to be a patch to add that option explicitly: http://bugs.mysql.com/bug.php?id=8904

link|improve this answer
Those are both good suggestions, but sadly they don't fit my needs. the first one because I want to work in interactive mode. And the second because I can not currently put the time into this. I was more looking for a built in solution but it seems that currently there is non. so I will continue reading my Hebrew from left to right :) – epeleg Mar 10 '11 at 6:54
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.