Hi Nandini
because I see some [ ... ] characters in front of the fields other than the 'flight number'?
Are you sure the strange characters are in
front of the other fields? I suspect what you are seeing is the "filler" which
follows the field. The database has fixed length fields, so if the data to go into the field is less than the size of the field, then the remainder of the field is filled with nulls (in the C sense: value zero).
So if you had a field which is 5 characters long, and you wanted to put the value "123" into it, then in the file it would be stored as "123\0\0", or in hex: 3132330000.
If you just take the read value of the field, then those nulls still exist. If you try and print them to screen, then they may appear as little boxes following your data (for example: "123��"). And, of course, if you try and compare them to data that does not have these nulls, then the comparison will fail.
That was a long way of trying to confirm what I suspect your problem is. And the solution is really simple:
String.trim()
Regards, Andrew