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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] row in the CSV file

Hi,
I would like to add to my csv file on the top some extra row to look like below, I am not sure how to do it using talend.
I have use a three different files from where I am doing mapping and look up but on the end when I insert to my csv file and just getting normal column population not sure how to make these empty rows before I get title for my second part.
Any help is welcome.
Thanks
Zeljka
colum1 colum2 column3
text,
text ,
text ,
title1 title2, title3
tesxt text, text,
text, text text
text text text
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Zeljka
I am back to you, I understand your request now, you need redesign the job like this:
the first part(output the result to a file as you done, let's say it is test.csv)
|
the second part---tFileOutputDelimited(output the result to a temporary file, eg: temp.txt, note that check the box 'include header')
|
tFileInputFullRow(Read the temporary file temp.txt line by line)--main->tFileOutputDelimited(output the result to test.csv, note that check the box 'append')
Best regards
Shong

View solution in original post

28 Replies
Anonymous
Not applicable
Author

Hi,
I put some screenshots for a job that uses a tForeach to write out the header lines (text1, text2, and text3) and follows this up by appending a standard input/tMap/output.
http://bekwam.blogspot.com/2011/02/quick-report-with-talend-open-studio.html
You could also use a block of Java IO in the prejob routine.
-Carl
Anonymous
Not applicable
Author

Hi Carl,
Thanks for your link but I still do not understand how to make my output to look as I wanted. I actually need on my existing file to add these
text,
text,
text,
text
columns and also in my case I am having 2 different files as input plus I am having lookup file and all these is mapped as one to produce one output file.
I have looked your example and had try but I am not sure when I use tForeach and link with tIterateToFlow I will need some schema but which one I will use .
I have to add I am pretty new Talend user and not really familiar with all these functionalaty.
Could you please try to give me some more explanation .
Thanks
Zeljka
Anonymous
Not applicable
Author

Hi,
I updated the blog post. I added screenshots showing the two schemas. Both schemas are used to write to the same CSV file.
The first schema describes a single field of type string. This will write out the text values defined in the tForeach component.
The second schema is probably more familiar. It describes the data that will make up most of the report. It can be taken from the repository. My example is writing contact info (first name, last name, etc.) using this second schema.
http://bekwam.blogspot.com/2011/02/quick-report-with-talend-open-studio.html
-Carl
Anonymous
Not applicable
Author

thanks,
I actually need to add the first 9 rows to my csv file , see my an attached file.
I hope your way is going to work..
Thanks
Z
Anonymous
Not applicable
Author

An attached file this time
Anonymous
Not applicable
Author

Hi Carl,
I have tried your way but still I can't make my csv file to look as I wanted.
I had try to creat two different input file one with first part of my test and second with other text below and to map but I can't get layout as I wanted.
Zeljka
Anonymous
Not applicable
Author

A few things to check
1. Use two tOutputFileDelimited components with the second one set to Append
2. Make sure that the second subjob -- the one writes the data out -- is run after the first with a Subjob OK
Anonymous
Not applicable
Author

I had try to have two output files as what Is show on the images, I have in my log file what I want but cant get in my csv input to be like that..
see below..
Anonymous
Not applicable
Author

schema