In Informatica there is a very handy option to automatically generate column names as a header row in the flat file output. This option serves its purpose except for the fact it places a “#” (hash) symbol at the beginning of the header row by default.
And, it seems there is no easy way to remove this hash symbol. Many solutions incorporate either generating the header row in a separate pipeline in the mapping or remove the hash by post process batch or shell script.
However, there is a hidden option in Informatica session properties which can do this without breaking any sweat. Unfortunately this option is only available in Informatica versions starting from 9.1.0 HotFix 4
Below are the steps to enable that option to remove the hash symbol while generating the header row. (Assuming the “Output Field Names” option is selected for the Header Options attribute in Target Properties section of the Mapping tab)
1. Open the Informatica Session in edit mode
2. Goto Config Object tab
3. Open the value field for the “Custom Properties” attribute in Advanced section
4. Create a new attribute value pair with below details
5. Click Apply and Ok. Save the session and execute it and you will notice the # symbol has now vanished
Above steps provide an elegant solution to a commonly occurring problem which many people solve using post processing or custom header generation.
Hopefully this trick saves some of your valuable time. Stay tuned for more tips and tricks to get the most out of Informatica Powercenter.
You can write to me at firstname.lastname@example.org or follow me on twitter @atalraghav
Comments are always welcome.
Thank you for this custom function tip…
This was of great help to me. However I have another issue regarding header row. On the lines with date fields the fields are surrounded by double quotes. Is it possible to achive this as well for the header row?
Tips will be much appriciated.
Regards Anita Skudal
Excellent. i have a question. What are the other attributes we can create like this. How is it working?
Awesome !!! Works well. Thanks
I am using 9.1 version ,and I have used the same option (Custom Properties)as above still I could see the # in the target file.
my manager not allowing me to write echo in session level. can anyone help me plz why it is not working.
thanks in advance
It’s worked. Thanks Raghav 🙂
Thanks a lot. you have helped us to get rid of a mess. Keep posting solutions.
I have a issue in generating a datatime value in output text file. There is column which has datetime datatype ‘MM/DD/YYYY HH12:MI:SS AM’ . I have converted the datetime field to char with the same datetime format and in the ouput text the datatype is string. In the text output only the date time values are populating and AM/PM is not populating. But while i am executing the Source Qualifier query the datetime value is populating with AM/PM.
Could you please help me to fix this issue.
Thanks for the tip, it worked nicely.
Did you check the length of the field populated.Is there any truncation while loading into the target.Can you increase the field length and try
superb… worked effectively instead of post session script.. this kind of properties will reduce the code and at the same time utilization of informatica provided properties are grateful
Thankyou..it worked for me too 🙂
Leave a comment