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

Hi,
in my tFileOutputDelimited I need for some reason 2 header lines before the data, one empty line and the header line itself.
e.g.
<empty line>
ColA;ColB;ColC
1;2;3
4;5;6
How can I achieve this goal?
Thanks
Guenter
Offline

I use TOS 3.1.1.
Advanced options are:
- Erweitertes Trennzeichen(für Zahlen) (delimeter for numbers)
- CSV options
- Bei Bedarf Verzeichnis erstellen (create directory if necessary)
- Split output in several files
- custom the flush buffer size
- output in row mode
- Encoding type
No way to set the nr of header lines in output
Offline
oups ... didn't seen it was an OUTput file !
What the structure of the input * ?
I 've tried with a tunite to add empty lines and header (uncheck skip empty row) but still have ';' in the first line
hum hum !
Last edited by kzone (2009-05-28 16:17:07)
Offline
ok,
it depends on your inputflow but you can create a empty file and append your data to it ... it will create the empty line that you need.
Ps : seems bad solution !! (with tfiletouch doesn't work and you have to create "by hand") ... so forget ...sorry !
++
Last edited by kzone (2009-05-28 17:03:24)
Offline

Hi guenniac,
Or insert a newline character at the beginning of the header:
http://www.talendforge.org/forum/viewtopic.php?id=6440
Cheers,
c0utta
Offline

Hi,
thanks for the advice.
Since I have to deal with thousands of files with big content I think counting the lines could be a performance drawback.
The idea of prepending the first element of the header line with a '\n' looks good but I don't know how to do this (I'm TOS beginner).
My idea is: when starting a new output file I copy a template containing just a line break to the output file and append the content of the input file(s).
Any further hints?
Regards
Offline

Hi guenniac,
No problems - we've all been beginners. You didn't specify Perl or Java so I'll use Java, but you'll get the idea.
Basically you need to detect the first line of the flow - there are many ways to accomplish this, but the easiest is to use a tJavaFlex (or tPerlFlex).
Start Code
boolean first = true;
Main code
row2.ID = row1.ID + ( first ? "\n2nd header line" : "" ); first = false;
Results
JbWmTY 2nd header line sKuqw8 PeOpQR p2Yx7W uVDIg4
I've used the RowGenerator to generate my data.
Cheers,
c0utta
Last edited by c0utta (2009-06-04 07:44:05)
Offline
Pages: 1