[resolved] Editing a .txt file in talend

One Star

[resolved] Editing a .txt file in talend

i have a txt file wit more data i need to add a / after a particular word.is it possible to edit the content of a file .

Accepted Solutions
One Star

Re: [resolved] Editing a .txt file in talend

i got the proper results
output_row.text = StringHandling.EREPLACE(input_row.text,"({4})","$1,");
Thank you all Smiley Happy

All Replies
Four Stars

Re: [resolved] Editing a .txt file in talend

Hi Avinash,
Read the file using tFileInputDelimited
use Ereplace system function for your "particular word" by "particular word" + "/"
output_row.text = StringHandling.EREPLACE(input_row.text,"avinash","avinash/");
use above code to to replace avinash by avinash/. This logic may help.
Thanks
Vaibhav
Moderator

Re: [resolved] Editing a .txt file in talend

Hi,
Or component TalendHelpCenter:tFileInputFullRow reads a given file row by row in case there is no consolidate field separator in your .txt file.
tFileInputFullRow-->tMap....ReplaceAll(string s1, string s2) in expression.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Editing a .txt file in talend

i want to add a comma after finding some fileformat like .txt .pdf .jpg .csv
with output_row.text = StringHandling.EREPLACE(input_row.text,"({4})",what should i mention here);

i have tried few things but dint get proper result

i want the output to be .txt,.pdf,.jpg,.csv
One Star

Re: [resolved] Editing a .txt file in talend

i got the proper results
output_row.text = StringHandling.EREPLACE(input_row.text,"({4})","$1,");
Thank you all Smiley Happy
Moderator

Re: [resolved] Editing a .txt file in talend

Hi,
It is great. Thanks for sharing it with us.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.