First of all, tell us how you initialized the file variable. It's possible that you used a wrong delimiter. Then - please - use debugger to look at the content of your container. Trying to find bugs by merely observing the final result is extremely difficult, therefore it's a bad idea. You already see that you're unable to identify the problem with your current approach. You really need to use the debugger to see what's going on in your code. Start with looking at the record variable. If it doesn't contain correct values, go to the method generating the value and find what's wrong. If it's correct, all previous code irrelevant and the problem is in writing the container to the file. By the way, we couldn't run your code, because it depends on data in your database and on variables of unknown values. If you want to demonstrate a problem to somebody, it's not enough to copy/paste some code. You should extract relevant parts of code (without any external references) to a job that anybody can run. Very often, this exercise will help you to isolate and understand the problem and ultimately to fix it. So don't be lazy to do that.
↧