骆驼:如何跳过CSV文件中的多个标题行 [英] Camel: How to skip multiple header lines in CSV files

查看:123
本文介绍了骆驼:如何跳过CSV文件中的多个标题行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将使用Apache Camel处理CSV文件.我的文件有多个标题行.在骆驼中,我只能找到 skipFirstLine skipHeaderRecord (我不清楚),但是如何跳过多行呢?

I'm going to process CSV files using Apache Camel. My files have multiple header lines. In Camel I only find skipFirstLine or skipHeaderRecord (which is not clear for me) but how to skip more than one line?

推荐答案

您可以在处理身体之前在身体上使用tokenize方法.

You can use tokenize method on your body before processing the body.

tokenize(String token, int group, boolean skipFirst)

示例:

`from("filePath").
    split(body().tokenize("\n",1,true)).
    streaming().
    process(exchange -> {....}).
to("filePath");`

这篇关于骆驼:如何跳过CSV文件中的多个标题行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆