iryndin / jdbf

Java utility to read/write DBF files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The last record is read twice

iryndin opened this issue · comments

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