Six Stars

Generate and Split XML

Hello all,

 

I am generating an XML file which is approximately 1.5 Gb and as far as now its works perfectly.

 

In order to avoid, outofmemory exception (reap size or garbage collector) if ever there is an increase in my input files, i want to implement the process below:

 

Here is my idea :

Instead of generating a large file, i want to generate multiple xml file but it should be according to a size limit.

I also want to make sure that each file has its opening and closing root tag.

 

In other words, if the file generated has come to the size limit declared then process the last row along with its closing tag....repeat...

 

Can this be done via TOS Big Data v6.4 ?

Can you please advice ?

 

Here is my job : 

 

Capturea.PNG

 

My tFileInputDelimited_1 contains 88,900 rows.

 

Best regards,

asadasing

1 ACCEPTED SOLUTION

Accepted Solutions
Eleven Stars

Re: Generate and Split XML

This tutorial is not exactly what you want, but it is pretty close and you can probably use the theory behind it to achieve your goal. Essentially you can group your data into batches and produce an XML per batch. So, if you can guesstimate the number of records in a batch which meets you size criteria, you can produce XML chunks to that size.

 

The key thing here is using a tLoop (or maybe an iterator if you can batch and group in your database) to produce different files.

 

Take a look: https://www.rilhia.com/tutorials/load-xml-files-batches-records

Rilhia Solutions
2 REPLIES
Eleven Stars

Re: Generate and Split XML

This tutorial is not exactly what you want, but it is pretty close and you can probably use the theory behind it to achieve your goal. Essentially you can group your data into batches and produce an XML per batch. So, if you can guesstimate the number of records in a batch which meets you size criteria, you can produce XML chunks to that size.

 

The key thing here is using a tLoop (or maybe an iterator if you can batch and group in your database) to produce different files.

 

Take a look: https://www.rilhia.com/tutorials/load-xml-files-batches-records

Rilhia Solutions
Six Stars

Re: Generate and Split XML

Genius