This project has moved and is read-only. For the latest updates, please go here.

Cariage return _x000D_

Jul 28, 2011 at 12:37 PM

When I load a string from an Excel cell the returns are not translated correctly. _x000D_ is not converted to \r allthough its followed by a \n which suggests the newline character is converted correctly. Or am I doing something wrong?

Oct 26, 2011 at 7:27 PM

I'm seeing the exact same thing. Line breaks are in the data, but I'm also seeing the literal _x000D_ at every new line.

Debugging, this is the data being reported by OpenXML to ClosedXML. Renaming my Excel file to a .zip and opening xl/sharedStrings.xml itself, I see the same literal _x000D_ in there. Whatever it's doing, Excel is working around it. Anyone know what's going on here? Is this intended behavior and it's a magic string Excel is looking for?

Oct 26, 2011 at 7:45 PM

icrf, please create an issue and attach a sample file that can reproduce the error when it's loaded/saved.


Oct 26, 2011 at 8:24 PM

Upon closer inspection, it looks like there is another character in there that Excel is simply suppressing. When moving the cursor in the cell, it moves to the end of the line, then nowhere, then the beginning of the next line.

The file I'm working with was put together by someone collecting data from many different sources, so it's not at all unreasonable to assume that some of the copied data has been through a couple different unix/windows/mac end line conversions and isn't in the right state.

I'll make an issue and upload a sample so you can take a look.