Reputation: 1
I'm using apache camel in a routing context to integrate some CSV files. If I want to skip the first line of the csv I can easily do it in the unmarshal:
<unmarshal>
<csv delimiter=";" skipFirstLine="true"/>
</unmarshal>
My question is, whats the best way to ignore/skip the last line of the file ?
Thank you in advance,
Upvotes: 0
Views: 1110
Reputation: 523
The last line can not be skipped. Please read the file from the end and remove the last line using a File Reader
Upvotes: 0
Reputation: 341
Camel CSV component (ver. 2.18.1) does not support skipping the footer out of the box. In case you can keep the whole file in memory I would advice to use a Camel processor to remove the last line before unmarshalling.
There is also a similar question answered by Claus Ibsen for the Bindy Component: Camel CSVRecord Camel Bindy
Upvotes: 2