I have a table that uses the script below to create fields with Spaces at the start of the field value.
The way this works is if,for example, a field length is set at 12 characters and the value for the field is 8 characters long, it should have 4 spaces at the start - 8 + 4 = 12.
This is a requirement of the database I'm loading into.
So now I've got all my field lengths sorted out, I need to export this table as a Flat File and maintain the spaces & characters as I've defined them.
To do this, I've selected in the Flat File Destination settings to export as a 'Fixed Width' file.
I found out after getting an error that any Field Heading that is longer than the Length set for that field.
That meant that if a field had a set length of 1, the field heading could only be 1 character long.
Obviously this has caused some problems which I'm trying to avoid.
My question is - Would I still retain my spaces & field name formatting if I didn't select the 'Fixed Width' option when I set the options for exporting as a flat file?
Has anyone come across this before & if so, how did you work around it?