0

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,

Kenster
  • 23,465
  • 21
  • 80
  • 106

2 Answers2

2

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

Community
  • 1
  • 1
kris_k
  • 341
  • 2
  • 10
0

The last line can not be skipped. Please read the file from the end and remove the last line using a File Reader

javalearner_heaven
  • 483
  • 1
  • 6
  • 21