Serious, you need to gain some skill in Object oriented programming. One key skill would be understanding the ins and outs of reflection. With reflection, you can write code that can handle virtually an class type you can throw at it. I am also in my early 40's but I made sure to learn Object Oriented programming first in Visual Fox Pro and then some Java code and finally the
.NET framework during my 30's.
If you need to write a series of different CSV formats with specific field names and some hardcoded values, consider using reflection to write a custom writer class that you can pass in a format map class and the data class into. The data class should have all data you want to expose stored in public properties if you are using .NET. If you are writing to XML, just create a class with a property hierarchy to match your data structure including the hierarchy and use the builtin XMLserializer. Be careful if you plan on outputting to a string first as strings are Unicode (UTF-16) whereas XML is usually UTF-8. You might have to extend the Stringwriter class with an Encoding parameter.
I hope someone finds these tips useful.