How to remove the hash symbol from Informatica header output

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
Attribute:- RemoveOutputHeaderHash
Value:- Yes

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 raghavatalblog@gmail.com or follow me on twitter @atalraghav

Comments are always welcome.

12 thoughts on “How to remove the hash symbol from Informatica header output”

  1. Hi
    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

  2. Hi friendz,

    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

  3. Hi Raghav,

    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
    Savin

  4. Hi Savin

    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

  5. 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

    Thanks Raghav

Leave a Reply

Your email address will not be published. Required fields are marked *