Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] write string to text file

I require to format my variables from a database table inserting them into a text file (not csv)
How can I simply write a text file? I want to format it the same as you would format an email. Is this an existing feature?
(I am using a java project).
Thank you for any help.
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello,
tFileList----iterate(x 5)-----tFileInputDelimeted---row------SOMEPROCESSING--------tMysqlOutput(parallel execution enabled.)
Is there any way to do that.
Thanks

You can create the job like this:
main job:
tFileList--iterate--tRunJob_1
tRunJob_1: call the child job and pass the current file path (and the current file name) to the child job for use later, uncheck the 'die on error' option.
child job:
tFileInputDelimited--main-->someprocessing-->tMysqlOutput
--onsubjobok-->tFixedFlowInput_1---main-->tFileOutput
--onsubjoberror_>tFixedFlowInput_2_-->main-->tFileOutput
check the 'die on error' option both on tFileInputDelimited and tMysqlOutput
on tFixedFlowInput_1, define two column or more columns depends on your need, let's define two column:
filename: set the value with current file name or file path
status: set the value as "success"
on tFixedFlowInput_2, define two column or more columns depends on your need, let's define two column:
filename: set the value with current file name or file path
status: set the value as "failure"
Shong

View solution in original post

7 Replies
Anonymous
Not applicable
Author

Hello
I require to format my variables

What do you mean here? Can you give us an example?
inserting them into a text file (not csv)

Just use a tFileOutputDelimited to output a file, set the extension of file name as: .txt

Best regards
shong
Anonymous
Not applicable
Author

basically I have 2 tables, from the first table I must pull a row of data, then pull all the corresponding data in the second table.
From the first table I must make a text output similar to this:
client_nr=1
branch_nr=1
sent=0303030303
ordered=202020202
then for every row from the second database I must output something similar to
rowDetails=1,2,3,4;
The tfileoutputdelimited I shall look into, if you have a better idea now seeing the format which I require please do let me know.
Anonymous
Not applicable
Author

Hello
You can do a a join, add new columns and set fixed value on tMap, eg:
add a new column called key and set a fixed value base on row number.
On the tFileOutputDelimited, define the field separator as "=".
If you give me an example of your first table and second table, and what your output file looks like, I can give you a demo.
Best regards
shong
Anonymous
Not applicable
Author

Hello,
i am creating a Job for processing of files , process it , save it in db.
While doing this i want to log filename with their status like they processed successfully or not in a file or DB.
tFileList----iterate(x 5)-----tFileInputDelimeted---row------SOMEPROCESSING--------tMysqlOutput(parallel execution enabled.)
Is there any way to do that.
Thanks
Anonymous
Not applicable
Author

Hello,
tFileList----iterate(x 5)-----tFileInputDelimeted---row------SOMEPROCESSING--------tMysqlOutput(parallel execution enabled.)
Is there any way to do that.
Thanks

You can create the job like this:
main job:
tFileList--iterate--tRunJob_1
tRunJob_1: call the child job and pass the current file path (and the current file name) to the child job for use later, uncheck the 'die on error' option.
child job:
tFileInputDelimited--main-->someprocessing-->tMysqlOutput
--onsubjobok-->tFixedFlowInput_1---main-->tFileOutput
--onsubjoberror_>tFixedFlowInput_2_-->main-->tFileOutput
check the 'die on error' option both on tFileInputDelimited and tMysqlOutput
on tFixedFlowInput_1, define two column or more columns depends on your need, let's define two column:
filename: set the value with current file name or file path
status: set the value as "success"
on tFixedFlowInput_2, define two column or more columns depends on your need, let's define two column:
filename: set the value with current file name or file path
status: set the value as "failure"
Shong
Anonymous
Not applicable
Author

Thanks Shong, for replying.
The above setup works.
Thanks again.
Anonymous
Not applicable
Author

Hi Shong,
Above setup works fine.
But the thing is that, when I tried to create a zip of all jobs using 'Build Job' Option in Talend and try to upload it in TAC, it is showing me an error like jobinfo.properties is missing at root.
but while creating individual Build of every jobs, jobinfo.properties is present in every zip file.
So, the question is how to upload and run all these jobs in TAC (Talend Administration Center)?
Hope you got the question.
Thanks.