One Star

Ignoring first line and last line of a csv file

Hi all,
i have to read a csv file, but i have to ignore the first and the last line of that file because they are only control lines. I used tFileInputPositional.
How can solve removing those lines?
Any help appreciated.
Thanks

Luke
7 REPLIES
Seventeen Stars

Re: Ignoring first line and last line of a csv file

hi,
in the component properties you've put the numbre of line to skip (in your case 1 ) for header and footer.
In case you use a metadata at the "step 3 of 4" do the same.
One Star

Re: Ignoring first line and last line of a csv file

I put this values in the component, but the componet seems to read again the first and last lines.
I am using talend 2.4.2
One Star

Re: Ignoring first line and last line of a csv file

i think in particular that the if i set the value 1 in the footer field, the last line is processed the same.
Seventeen Stars

Re: Ignoring first line and last line of a csv file

did you try with metadata tFilePosionnal !?
'cause I always use this way to create a new component (i can re-use it anyway) , and it's work fine !!(test the result by a "refresh...") ...
One Star

Re: Ignoring first line and last line of a csv file

Do you create a tFilePositional directly from the metadata repository?
One Star

Re: Ignoring first line and last line of a csv file

No i don't use it, i tried it also. but didn't worked.
Community Manager

Re: Ignoring first line and last line of a csv file

Hello
I tried it and it works fine on TOS2.4.2. You need to set the Header:1;Footer:1
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business