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.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now