in reply to file i/o beyond my knowledge

yep.

If you would like to show us your try at it we could point out issues and resolutions.

-Waswas