Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Split FlowContent by line and extract text to attributes NIFI

Tags:

apache-nifi

Im using NIFI and i want to extract attributes of my file lines .

My Filetext looks like this :

DEV=A9E ,SEN=1
DEV=B9E ,SEN=2
...

And i want to split text by line and then extract dev and sen to attribute , any way to do this with NIFI, i have tried split text and split content but I can't see how can I split text by line.

like image 367
azelix Avatar asked Jan 17 '17 11:01

azelix


1 Answers

SplitText with a Line Count of 1 is generally the approach to split a text file line-by-line. It will use \r, \n, or \r\n as the end of a line.

ExtractText would be used to parse each line and extract parts of the line into flow file attributes. You need to come up with a regular expression that uses capture groups to capture the parts you are interested in.

like image 88
Bryan Bende Avatar answered Nov 12 '22 01:11

Bryan Bende