1
Vote

ExcelRangeBase.LoadFromText doesn't read empty string correctly

description

I've noticed that when reading from a CSV file to a worksheet using the LoadFromText method, the values of cells that should contain an empty string are set to the string qualifier. For example, is the text qualifier is a double quote, the value "" in the CSV becomes " in the worksheet. I've already submitted a quick fix on the fork at : https://hg.codeplex.com/forks/patrick1/csvreadfix, but the unit test I added is very basic and doesn't really conform to any standard. I couldn't find any other tests for this method, so I don't know if this had any side-effects that I'm not seeing.

All I did was remove both occurences of the lines :

if (QCount > 1)
{
v += new string(Format.TextQualifier, QCount / 2);
}
I'm not sure what these were meant to do.

Can someone please have a look at this issue an see if this fix works?

comments

JanKallman wrote Mar 22, 2012 at 7:01 PM

Thanks, I'll have a look at it.

gsbell wrote Jun 1, 2012 at 9:39 PM

Can someone please fix this? Thanks.