Four Stars

Inserting a string below 1 row in output file.

Hi all,

I am a beginner to Talend Open Studio. 

I am processing a delimited text file in tFileInputDelimited and mapping it to 3 different tFileOutputDelimited using tMap and appending all tFileOutputDelimited to the same output file. But I need to insert a very long string as a row in the output file just below the rows coming from 1st tFileOutputDelimited and just above the rows coming from 2nd tFileOutputDelimited.

Please suggest solution for this.

 

Thanks in advance!!

 

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Employee

Re: Inserting a string below 1 row in output file.

You should not link it to your input.  You should do it indepent of your input.  It may be more complex needing additional components etc.  It depends on your exact logic.  Maybe you should have a few tMaps and do it in multiple steps.  Or use tUniqRow etc.

5 REPLIES
Highlighted
Employee

Re: Inserting a string below 1 row in output file.

Just like you are appending the 3 output to 1 file, you will ouput the 1 string to the file.  You will simply have 1 column in your tFileOutputDelimited definition and you will not output the header.  This long string message will go into your file in between the 2 different outputs.  The long string can be an output from the tMap.  Hence, you will have 5 outputs instead of 3.  Make sure you keep same line delimiter though.

 

Four Stars

Re: Inserting a string below 1 row in output file.

Thanks iburtally for replying.
What I understood from your solution is that simply I have to put the long string in a single column in separate output of tMap and then to row this output component to one separate tFileOutputdelimited and append it to the same file.
But in the output file, I am getting the string for 66 times/rows (Which is also total no. of rows in my input file). I want only one row of that string.
Employee

Re: Inserting a string below 1 row in output file.

You should not link it to your input.  You should do it indepent of your input.  It may be more complex needing additional components etc.  It depends on your exact logic.  Maybe you should have a few tMaps and do it in multiple steps.  Or use tUniqRow etc.

Four Stars

Re: Inserting a string below 1 row in output file.

I am not putting it in the input section of tMap. I have put it in the output section only. it's not linked to input. Okay I will take a look at tUniqRow.
Thanks Smiley Happy
Four Stars

Re: Inserting a string below 1 row in output file.

tUniqRow worked!!

Thanks Smiley Happy