1

我有 csv 日志文件,我将其转换为 GeoJSON,ogr2ogr然后运行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。

4

1 回答 1

3

试试这个方法

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

输出:

[
5
6
7
8
9
于 2015-11-20T05:45:05.090 回答