
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to APPEND existing file without losing its old content ??
hello, I am new to talend, I have two ambiguities, I tried to find a way to extract the rows from an excel table or a text file into a list as a temporary variable to then iterate over this list element by element with in a TsendMail component. i could not use list properly .
My second problem is how I can add data below the data already written in a text or excel file, i.e. we always create new files with the data we are processing but can we create the file once then at each iteration we add (modify) lines in the file WITHOUT OVERWRITING its content? 🙂 thank you
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can append the email address to a context variable on tJavaFlex, and use this context variable in the To field of tSendmail.
//context.to_list is context variable with string type, let the value as empty by default.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@amine kacem​, the first question, I don't understand it well, can you show us an example to explain what you are trying to achieve?
About the second question, there is an option 'Append' on tFileOutputDelimited or tFileOutputExcel component, you can check this option to append data to existing file.
Regards
Shong
​

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Shicong Hong​ thank you sir ,
i found that append and tried it , it worked well even after adding new column betweeen iteration .
for my other question here is a senario i want to achieve in the photo . all i want now is jsut to put a list of email adresses in the To" option of TsendMail so that i can send files to list of people at the same time , i could not find out how to pass the list to that To" option nor to collect infos in that list.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can append the email address to a context variable on tJavaFlex, and use this context variable in the To field of tSendmail.
//context.to_list is context variable with string type, let the value as empty by default.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you a lot for the clarification , but one last question please to close this topic this that i still don't figure out how to make a componenet start when a hole job completes instead of a single component completes its work ; most of the time when i want to link TsendMail after a job , i just find "on component ok " LINK so i just go with that , but i really want a way to make tSendMail only runs after all the job complete all its iterations 🙂 check this screen shot , this happened for me for first time where ican see "on subjob ok " which is the thing i am searching for 😄 so does that means after all that little job complete , my function tSendMail will start ?? if so , how can i always do like that ?? i mean how can i click so that "on subjob ok " appears always ??
