You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

Hello.
I have 1 txt file with 3 colunms, lets say, id;name;result
I want to split in several files by name;result
I have the context.name in a tjava_row
How can I transform this context in several files?
Thanks in advanced.
Offline

I was trying to use that context to distinct data from the input file, and to use it to give names to the splited files
Offline
Hi
Not need to use context variable, just iterate each row and set a dynamic output file path. The job design looks like:
tFileInputDelimited--row1(main)--tFlowToIterate--iterate--tFixedFlowInput--main--tFileOutputDelimed
on tFixedFlowInput, generate each row of input data, define two columns the schema, name and result.
key:value
name:(String)globalMap.get("row1.name")
result:(String)globalMap.get("row1.result")
on tFileOutputDelimited, set a dynamic output file path, for example:
"D:/file/"+(String)globalMap.get("row1.name")
Check the box 'append' on tFileOutputDelimited.
Best regards
Shong
Online

Or3l wrote:
Hi,
You have to create several output, don't think you can do it dynamically 'cause I don't know if it s possible to retrieve column name in talend.
He wants the column data not the column name.
Offline

Hello,
shong, perfect!! It was exactly I need!
Thanks.
Offline
shong wrote:
Hi
Not need to use context variable, just iterate each row and set a dynamic output file path. The job design looks like:
tFileInputDelimited--row1(main)--tFlowToIterate--iterate--tFixedFlowInput--main--tFileOutputDelimed
on tFixedFlowInput, generate each row of input data, define two columns the schema, name and result.
key:value
name:(String)globalMap.get("row1.name")
result:(String)globalMap.get("row1.result")
on tFileOutputDelimited, set a dynamic output file path, for example:
"D:/file/"+(String)globalMap.get("row1.name")
Check the box 'append' on tFileOutputDelimited.
Best regards
Shong
I have a problem just like this one but this solution does not work for me as I am working with huge files 1Gb+ , iterating with each row reduces the performance.
I am looking for a more dynamic way for this kind of process. Do you have any idea about how can I do it without iterating?
Offline

Thanks Shong
Offline
Pages: 1