【问题标题】:How to add headers to a csv using apache nifi如何使用 apache nifi 将标题添加到 csv
【发布时间】:2019-11-06 15:05:56
【问题描述】:

我想向 csv 文件添加标题,我在这里使用了给定的指令。 Nifi: how to add custom header to CSV file,我使用了Replace text 处理器并更改了此处给出的参数。

但最终输出只是将标题附加到第一行。

示例:

1,sachith,SO,1587

预期输出:

id,name,site,score
1,sachith,SO,1587

输出:

id,name,site,score,1,sachith,SO,1587

我应该使用其他处理器还是缺少配置文件?

【问题讨论】:

  • 只需在替换值的末尾添加一个新行
  • 我使用id,name,site,score\n 作为替换值,但仍然相同。 \n 被视为一个值。
  • 在标题行之后输入 shift+enter 而不是 \n。
  • 那行得通。您能否将其发布为我可以接受的答案。

标签: csv apache-nifi


【解决方案1】:

不要使用\n,而是在标题行之后使用shift+enter

【讨论】:

  • 非常感谢,我搜索了整个互联网,只有这个答案有效!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-10-19
相关资源
最近更新 更多