I format my data with my field name in the data already. If the field is blank then I don't put the field name in and the field will show up blank in your document. So my field does not look like this
Phone: << PhoneNo >>
it just looks like this
<< PhoneNo >>.
Using a spreadsheet it is very easy to make a simple formula to add the field name to the data where you want to or any other text or formatting for that matter. I start off with my raw data on one sheet in the workbook and then I use formulas to copy that data over in another sheet where I add the formatting that I want. Using this method, in your formula, you can test for blank cells (fields) in your raw data and replace them with a blank in the cell of your formatted result sheet. If the data is not blank then put in the field name or any other text and formatting and append the raw data to it.
Using two different sheets in the same work book, here is an example of a formula that produces a totally blank cell in my result sheet if there is no phone number in my raw data sheet or, conversely puts the label Phone No: into the cell with the actual phone number following it, in this case the actual phone number comes from cell A2 of my raw data sheet.
=IF(RawDataSheet!A2="","","Phone No: "&RawDataSheet!A2)
This formula means that if Cell A2 in my Raw Data Sheet is blank then show a blank cell in my result sheet otherwise show the text Phone No: and add the data from cell A2 in my Raw Data Sheet.
Using this method you can make all kinds of formatting of your data and also use conditional formatting if you would like. For instance you could format that phone number like this (012) 345-6789 or whatever. You just have to brush up on your spreadsheet formulas. Obviously once you spend the time to do one row of data the way you like it then you can copy it for thousands of rows and they will all produce the same result unless you have problems in your raw data but you could even test for that too.
Once this is all done I copy then paste my result sheet to a new single sheet work book using the Paste Values command and save that as a CSV file and I'm good to go. Don't forget to bring your field names over in the first row of your final sheet.