My Oracle Support Banner

Adding Header to a file using eScript (Doc ID 490919.1)

Last updated on MARCH 02, 2017

Applies to:

Siebel Tools - Version 7.7.2 [18325] to 8.1.1 [21112] [Release V7 to V8]
z*OBSOLETE: Microsoft Windows Server 2003
Product Release: V7 (Enterprise)
Version: 7.7.2 [18325]
Database: Oracle
Application Server OS: Microsoft Windows 2003 Server
Database Server OS: IBM AIX 4.2

This document was previously published as Siebel SR 38-2724657621.
***Checked for relevance on 03-Jan-2014***


I am trying to read a file using "Read CSV File" BS. For that i had to provide the Integration Object Name and Integration Object Component.Field Names as a header. Since i am not being provided with the header, i have write the header to the file using a eScript before passing it on to the "Read CSV File" BS.
I used the following code for that:

var sFileName = "C:\\CampaignFiles\\FixLoadFiles\\test.txt";
var fp = Clib.fopen(sFileName,'r+');
Clib.fprintf(fp,"#Princess Mrkt Marketing Camp Con CCN" + "\n" + "#Marketing Camp Con.CCN" + "\n");

The code behaves as follows:
It removes the first few lines of the file and then writes the header i provided.
If i open the File with the "a" mode, it writes the header string at the end of file.
Please advice be what to do. It is very urgent. Please find the files with and without header in the attachments



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document
 Message 1

This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.
My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.