title: MySQL: carriage-return in query
body: <p>I have a query that exports data from two columns of each row into a file. In the file data from each column should be separated by carriage-return, something like this:</p>
  
  <p>row1column1<br>
  row1column2<br>
  row2column1<br>
  row2column2<br>
  row3column1<br>
  row3column2</p>
  
  <p>I tried using char(13):</p>
  
  <pre><code>SELECT CONCAT(column1, char(13), column2) FROM my_table INTO outfile 'my_file'
  </code></pre>
  
  <p>and the output file seemed perfectly fine (each column data was in another line), but when I used it as input to a program that should accept described format, it didn't recognize it. However, when I manually erased all carriage-returns in the file and added them again by pressing "enter" key, my program recognized the file without a problem.
  When I tried with char(13), char(10), my output file looked like this:</p>
  
  <p>row1column1<br>
  \<br>
  row1column2<br>
  row2column1<br>
  \<br>
  row2column1</p>
  
  <p>I'm sure I'm missing something obvious here :)</p>