Created 12-21-2016 10:32 AM
Hi, i am very new to NiFi and following some tutorials, but most deal with json and xml. Can NiFi extract rows of data from files such as csv etc. For example if i wanted to extract row 2 which has a header longitude and row 3 with a header latitude.
Thank You.
Created 12-21-2016 11:25 AM
@Roger Young since your csv seems to be of fixed columns, you can use an combination of Replace and Extract text.
You can use one the example template here which converts csv to json, the first step is what you need.
https://cwiki.apache.org/confluence/display/NIFI/Example+Dataflow+Templates
Created 12-21-2016 11:46 AM
Hi, i was trying that template yesterday but didnt fully understand what it was doing by replacing, extracting and replacing text. It worked on the headers of the csv, but it didnt convert the rows of integers under the headers. I am trying to extract a row, the header which will be text and then the rows under that header which will be integers
Created 12-22-2016 02:40 AM
Assuming you are using a file on the file system you should be doing the following.
you could use "split text processor" after fetcing the file, to split into single lines and then process as needed further as needed.