Saturday, October 26, 2019

mysql client: change output columns separator

Thought of this to be a very basic issue which people would have definitely faced. But unfortunately, I couldn't find a solution for this after searching a lot.



I am using mysql command line client to run a query, and later on parse the output as per my requirement. By default, it returns output as tab separated. And some of the columns of the table have tabs in it.



Because of this, I am not able to parse it properly as the tabs in column data are not escaped. When I cut my output for tab, I get more columns then expected.




I will be using select * from table type queries. So replacing tab column wise in query is not an option.



Checked at mysql doc for any available option but there doesn't seem to be any. Any way to solve this?

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...