Jump to content

MySQL table cells look blank, but contain CHAR(13)


mrherman

Recommended Posts

I imported a CSV which had some blank cells.  I tried to deal with the cells by using (for example)

 

WHERE myfield = '' or myfield = ' '

 

I couldn't get anything to work, so I copied the contents of one of the cells and pasted it in a text editor.  Come to find out, the cells contained CHAR(13) -- carriage returns.

 

How did carriage returns get into the cells of the CSV?  I generated the CSV from an EXCEL spreadsheet.

 

Thanks!

Unless you had one long line in the file, each line had some kind of a new-line (cr/lf) on the end of it to cause the next line to be a separate line. Those new-line character(s) got inserted into your database unless you did something to remove them.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.