cancel
Showing results for 
Search instead for 
Did you mean: 

Add header to text file for a file that is sent over in segments

Former Member
0 Kudos

I have a file that so large I had to break into many segments. Now I have to write a header line in the first segment and none of the other segments. I have tried doing this with file content conversion but it writes the header in every segment. I have also looked to using Java Beans but this also put a header in every segment. Any suggestions to point me in the right direction would be greatly appreicated

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Carl:

Let me understand your requirement. You have a file (say around 1 Million rows/records) and the first row is header. You want to divide that file into small files ( each containing say 15000 rows) and only first file contains the header. is that correct. and Is it a File to File scenario??

Edited by: Guru on Feb 28, 2008 6:29 PM

Former Member
0 Kudos

Hi Carl !

The only idea I have right now, is to develop one Java Proxy Client and one Java Proxy Server, to use them as sender and receiver adapters.

In the sender, you can open the file and flag each segment with its "piece number", maybe as part of the filename (_001, _002, etc.)

Then in receiver, based on the piece number, you decide to add a header or not. You can also avoid the idea of the Java Proxy Server and use the file adapter with File Content Conversion and add the header record via graphical or java mapping.

Adapters are stateless, so once segments are in XI, you don't know whether one is the first one, a middle one or the last one, unless you store the state somewhere, for example, using JCO via java mapping or graphical mapping.

Regards,

Matias

ps :please award points if helpful