1

I have csv log files that I convert to GeoJSON with ogr2ogr and then run sed against to clean up for elasticsearch. Specifically:

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

I would like to run these commands in NiFi but I have not had any luck configuring ExecuteProcess.

DecisionNerd
  • 1,252
  • 1
  • 12
  • 19
  • This Answer may help you out. https://stackoverflow.com/questions/42443101/nifi-how-to-reference-a-flowfile-in-executestreamcommand – Eng7 Dec 27 '18 at 12:40

1 Answers1

3

Try this method

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

OutPut:

[
5
6
7
8
9
Kalanidhi
  • 4,902
  • 27
  • 42