I am using Structured Data Writer to write an xml file. In the file i have to write the information like filename, no of records etc in the header tag which will be written at the start of the xml file. The problem is although i can pass the number of records to this writer component, but i cant use a variable in the header. Is there any other way to write this info in header of an xml file.
Hi,
problem is that the Structured Data Writer (and any other writer component as well) doesn’t know how many records it will get. Number of processed records is known after processing all records already. My solution is to count records in Reformat component. In its finish method write header of the file and with Structured Data Writer save only the body and footer :(.
Thanx for you rreply, although i understood what u meant, but can you please explain this finish method and writing header at the end thing in detail. Should it be done by java code that is written in reformat class or is there any functionality in ETL to this, i mean opening the same file and then writing header.