The last record is read twice
iryndin opened this issue · comments
Ivan R commented
When I read my dbf, the last record always occurs twice
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.text.ParseException;
import net.iryndin.jdbf.core.DbfRecord;
import net.iryndin.jdbf.reader.DbfReader;
public class JDBFTest {
public static void main(String[] args) throws IOException, ParseException {
DbfRecord rec = null;
DbfReader reader = new DbfReader( new File("./src/gds_im.dbf") );
while( (rec = reader.read()) != null ) {
rec.setStringCharset( Charset.forName("Cp866") );
System.out.println( rec.toMap() );
}
reader.close();
}
}
Check this and make only single read of the last record
Ivan R commented
StackOverflow question is raised:
http://stackoverflow.com/questions/24883297/the-last-record-reads-twice-when-reading-dbf-in-java-via-jdbf