How to output csv file with header

Hi,
I’m currently trying to create csv file with header.
I follow the instruction from service development guide on Working with Flat files.

I successfully created the csv file in the format I wish. But there is no header line.
I been googling around but can’t find anything.
I try to look at the property setting on Dictionary and Schema but can’t see anything link to header line.

It will be good if someone here know trick and can share with me and others.

Thanks

Kenny

You can hardcode the “header field names” in the first row with the data before passing it to “pub.flatFile:convertToString”

It will output as below:

Id,Name
1,Mahesh
2,Sreenivas

1 Like

Hi Mahesh,

Thanks for the advise. I’m doing exactly the same.
Insert the first row of data as header line.

There also another question I like to ask.
In the schema file, under the Flat File Definition.
There is section called Quoted release character.
Based guideline provided in 9-10_Service_Development_Help.pdf, page 839. This could use this to double quote value in each column.
E.g. Fullname = SMITH, John
with the quoted release character = "
Fullname = “SMITH, John”
But it doesn’t work in my output file.
Any idea how I could get it working?

Thanks

1 Like

Hi Kenny,

please provide some screenshots from your flat file schema and flat file dictionary definition for cross checking.

Regards,
Holger

Hi Holger,
Sorry for the late reply. I was flatout with other urgent project before.

I have attached screenshot of my dictionary and schema here.
I’m learning using the flat file with the following example.

http://techcommunity.softwareag.com/pwiki/-/wiki/Main/Flat%20File%20Processing%20Tutorial