I am looking to build a text delimited file by extracting values from a database. This isn't your standard tab or comma delimited format, rather each record is contained in it's own file.

I have specific standards that determine both on what line a particular value must exist and between what clolumns. So for instance:

Field: First name
Must be placed on line three, starting at colum 4 and not extending past column 9.

Code:
 123456789
1
2
3    Mike
4
5
6
7
8
9
I'm hoping to find some sort of PHP Class that could possible help me construct this and maybe another to interpret/validate a text file like this. Any ideas?