0

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?

pratpor
  • 1,954
  • 1
  • 27
  • 46
  • Have you looked at mysql outfile eg http://www.tech-recipes.com/rx/1475/save-mysql-query-results-into-a-text-or-csv-file/, https://dev.mysql.com/doc/refman/5.7/en/select-into.html – P.Salmon Jan 04 '18 at 14:42
  • Btw, in the output the tabs in the field values should be escaped (unless you use the raw option), so should not cause much of an issue. – Shadow Jan 04 '18 at 15:04
  • Was trying on remote RDS. So `-B` is the option I used. – pratpor Jan 06 '18 at 14:28

0 Answers0