Appending data to a list of files.

Four Stars

Appending data to a list of files.

Hi group, I am a newbie to Talend and am stuck with this task. I've a raw file with 5 lines and 10 files in a directory. My requirement is to append these 5 lines as first 5 lines in each of the 10 files. Please comment any ideas!

Forteen Stars

Re: Appending data to a list of files.

use tfilelist to list all the files and iterate flow to tfileinputdelimited and the on target, tfileoutputdelimited enable Append.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Community Manager

Re: Appending data to a list of files.

Unfortunately append will only append to the end of the file....not the beginning. This needs to be thought about in a different way. Use the tFileList and iterate over the files as @manodwhb suggested. But in each iteration use a tFileCopy to copy your file with 5 rows to a new name. Then read from your files that are being iterated over and append that data to the end of the new file you've copied.

 

Four Stars

Re: Appending data to a list of files.

can you please elaborate your answer. Are you suggesting to connect tFileList to tFlowToIterate (which isn't possible)? or are you suggesting in another way.

Forteen Stars

Re: Appending data to a list of files.

@Pruthvi,you should desing as shown in screenshot.Untitled.png

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Forteen Stars

Re: Appending data to a list of files.

@Pruthvi,still do you an issue?

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch