Hi I am not very familiar with Regexs. The following is the json format data
being delivered to the replace text processor. 

{"NrRecords":1,"FileRecords":-1,"Records":[{"ISN":250,"AA":"11222222","AF":"S","AG":"F"}]}

I want to replace this with 
[{"ISN":250,"AA":"11222222","AF":"S","AG":"F"}]

and obviously the records can be more than one. I need to convert this JSON
to avro so i would need to define the schema first. The infer schema would
infer it based on the number of records that are retrieved. If they are more
than one then it thinks that this entire file is one record and passing it
through the "split avro" does not split it correctly (it does not split the
file and the output is the same original file). The ideal case would be to 
get rid of this header in the file and then I think it will be able to
process the records. I want to then split the file into seperate files equal
to the number of records retrieved.  

I am not very familiar with regex, groups and back-references. I was
wondering if there was a way to write a regex that extracts the value
between the first [ and the last ] and assign it back to the flow file
content. 

thanks
Arsalan



--
View this message in context: 
http://apache-nifi-developer-list.39713.n7.nabble.com/Replace-Text-for-updating-the-flow-file-content-tp13712.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Reply via email to