-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to parse Float #85
Comments
does anyone have any idea how i can resolve it? |
Hi, maybe more info would be useful to help you. |
hi, first thanks for the feedback i'm using version 1.11.1 of the library the full stacktracer
my class:
the error happens on the line while ((row = connDBF.nextRow()) != null) and drops the application can I send the file in your email? |
you can post the file here if it doesn't contain sensible data or email me the file, as you like. |
I sent in your email |
Hi I've updated some changes to be more verbose on exceptions, I've attached here Can you try with this one to get a more detailed messages? I've tried with https://github.com/albfernandez/javadbf/blob/main/src/test/java/com/linuxense/javadbf/testutils/DbfToTxtTest.java public static void writeToConsole(File file) throws FileNotFoundException {
DBFReader reader = null;
try {
// create a DBFReader object
reader = new DBFReader(new FileInputStream(file));
// get the field count if you want for some reasons like the following
int numberOfFields = reader.getFieldCount();
// use this count to fetch all field information
// if required
for (int i = 0; i < numberOfFields; i++) {
DBFField field = reader.getField(i);
// do something with it if you want
// refer the JavaDoc API reference for more details
//
System.out.println(field.getType() + " (" + field.getLength() + ") "+ field.getName());
}
// Now, lets us start reading the rows
Object[] rowObjects;
System.out.println("-------------------");
while ((rowObjects = reader.nextRecord()) != null) {
for (int i = 0; i < rowObjects.length; i++) {
System.out.println(rowObjects[i]);
}
System.out.println("-------------------");
}
// By now, we have iterated through all of the rows
}
finally {
DBFUtils.close(reader);
}
} |
Alberto I replaced the library as you requested, and now the error presented is this:
when I connect to the DBF table, DBFReader has 106765 records, when I try to populate the arraylist it will be with only 1098 rows, in other words, the error must be giving in the 1099 line of DBFReader, it gives the error and stops populating the array |
I need some time to investigate. I was wrong, it doesn't work for me, it stops at 1098 record, but without exception. there's some "buggy" in the file, as I can see, but others programs can open it, so I'll support it |
I do not believe it is related to bug 84, because I have been using your library for a while and I have used it in tables with more records than this, for example one with more than 400 thousand records I believe that it is incorrect filling in the double fields, or an excess of numbers that breaks the double, or alphanumeric characters using while on mine it also doesn’t point out the error, I changed it and made a for loop and then it fires the exception, follow the example code
|
I'm still not able to reproduce on my mahine, maybe some setup is diferent. I'm testing in Linux with openjdk 8 and openjdk 11 |
Hi, yes it's a normal FileInputStream I'm using Windows 10 64 bits and JVM 1.8.0_281 and JDK 8 update 251 (64-bit) |
I am getting the same exception while reading the stream from S3 (S3ObjectInputStream) or HDFS (FSDataInputStream), but working fine with local files (FileInputStream). |
have you tried to wrap your inputStream in a BufferedInputStream? |
yes, the problem occurs when I go through the DBFReader and consume the fields inside it, there is a field that is causing the library to drop and I still haven't found a solution for that |
Its funny, I have a similar error right now, but for me it's not Looking at the hexdump at that location, its actually in the file and not only T, but also F. What I did was taking an already existing legacy file, opening it and writing 2 rows into it, which then have this error. I attached the hexdump with a few lines for context:
|
Noticed, that I see a T and a F here, and the next field is defined as |
Looking closley at it, it looks like there is a space between the rows in the existing format, which is missing here |
I've released 1.13 with the proposed changed, check if it works for you |
No, unfortunatley exatctly the same error |
Hello, I had the same error and to solve it what I did was comment the DBFException that is thrown in readNumericStoredAsText to return null. How do you see returning null instead of the exception? null is a value that is returned when something goes wrong reading fields and it shouldn't cause any problems. Greetings and thanks for the effort! |
The purpose of return null in readNumericStoreAsText when try to create new BigDecimal(aux) is for continue reading the file, if exceptions throws the execution is stopped. |
I'm trying to consume data from a table but I'm getting the following error:
is giving error when trying to convert a double value, does anyone know how to proceed with this error?
The text was updated successfully, but these errors were encountered: