in reply to Parsing delimited file contents

All the code which opens and sends output to the file appear to be commented out.

I'd fall back to a trivial example. Open file, loop through, print read values. ( which it appears you're sorta-trying to do here ) Then when you have it showing you that it's doing the open/read/print/loop thing right, you can open the second file, and write the output there. Once THAT'S working, then just transform your data and you're done.