Readind the attached excel file usign hssf, I found that the SSTRecord only contains the unique strings, any duplicate string
in the excel file will cause null pointer exception.
Here is the code snippet: (The number of null pointers is exactly the number of duplicate string groups in the excel file)
case SSTRecord.sid:
SSTRecord sstRec = (SSTRecord)rec;
int total = sstRec.getNumStrings();
System.out.println("record size: " + sstRec.getRecordSize());
int numberOfNPE = 0;
for(int i=0; i<total; i++)
{
try{
String str = sstRec.getString(i);
System.out.println(i + ": " + str );
}
catch(NullPointerException ex)
{
numberOfNPE++;
}
}
System.out.println("number of NPE " + numberOfNPE);
break;
SampleEntries.xls
Description: SampleEntries.xls
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
