For help with reading/writing files, take a look through - File Input/Output Tutorials