【问题标题】:How do I run sed in ExecuteProcess in Apache NiFi如何在 Apache NiFi 的 ExecuteProcess 中运行 sed
【发布时间】:2016-02-22 11:20:12
【问题描述】:

我有 csv 日志文件,我使用 ogr2ogr 将其转换为 GeoJSON,然后运行 ​​sed 以清理 elasticsearch。具体来说:

ogr2ogr -f "GeoJSON" output.json input.csv
sed -i -e '1,4d' -e '$d' output.json # delete first four lines and last line
sed -i '1 i\[' output.json # insert line with '[' at beginning of file

我想在 NiFi 中运行这些命令,但我没有配置 ExecuteProcess。

【问题讨论】:

标签: bash sed dataflow ogr2ogr apache-nifi


【解决方案1】:

试试这个方法

seq 10 | sed -e '1,4d;$d;' -e '5 i\['

输出:

[
5
6
7
8
9

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-02-28
    • 1970-01-01
    • 2019-07-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多