Sounds like you know what you're doing..
So you get four arrays, process them, repeat ad infinitum until finished? I don't know c++ syntax, but seems like you're going to want a loop(exit when end of file) within a loop(exit when end of line), use some number to keep track how many lines you have read, this way you can easily tell when you've used up 4 lines, so then make a subprocedure call to process them.
I can't really tell what your problem is specifically, but if all your asking is how to find a carriage return, thats easy.. but I can't help