>> Could it have something to do with my compiler?
No, it's your code!

Why not break it down into smaller sections, just to try and see where you're going wrong.

Try creating some code that will simply read the file into the variables you want, then loop through those variables, printing them. This will prove that you can read input correctly.

Then, extend this to print only one record, based on the input string (contact name or whatever). Use the code you already created for doing the read and loop, just add a compare statement to print only the desired line.

Then, work on the output side.

This might seem the long way round, but it'd probably be worth it for you. I've had a closer look at your code, and can see a number of logic/flow problems that you'd most likely avoid if you worked in chunks.