Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to ExtractText from flow file using Nifi Processor?

Highlighted

How to ExtractText from flow file using Nifi Processor?

New Contributor

Hello,

splittext flow file

flowfile example,

Delimiter ';'

1096;2017-12-29;2018-01-08;10:07:47;2018-01-10;Jet01

Attribute 1 : 1096

Attribute 2 : 2017-12-29

Attribute 3 : 2018-01-08

Attribute 4 : 10:07:47

Attribute 5 : 2018-01-10

Attribute 6 : Jet01

how can I set the Attiribute?

FlowFile

51401-flowfile.jpg

SplitText

51402-splittext.jpg

ExtractText

51396-extracttext.jpg

Please help me

3 REPLIES 3

Re: How to ExtractText from flow file using Nifi Processor?

What exactly are you trying to achieve? It might be easiest to use one of the Record processors with a CSV reader.

Re: How to ExtractText from flow file using Nifi Processor?

New Contributor

text data import table.

Data share text format in ftp.

I will add the incoming data to the table. How do I split the columns into columns. How to define column values as properties with ExtractText

Re: How to ExtractText from flow file using Nifi Processor?

Super Guru

@Murat Menteşe

In Extract Text processor add new properties in configure menu by clicking on the + sign at right corner.

Configs:-

Attribute 1

(.*?);

Attribute 2

.*?;(.*?);

Attribute 3

;.*?;(.*?);

Attribute 4

^.*;.*;(.*);.*;

Attribute 5

^.*;.*;.*;(.*);

Attribute 6

^.*;.*;.*;.*;(.*)

Screenshot:-

51408-extracttext.png

(Or)

Add properties with below regex matches

Attribute 1

(.*?);

Attribute 2

.*?;(.*?);

Attribute 3

;.*?;(.*?);

Attribute 4

.*?;.*?;.*?;(.*?);

Attribute 5

.*?;.*?;.*?;.*?;(.*?);

Attribute 6

.*?;.*?;.*?;.*?;.*?;(.*)

Screenshot:-

51410-extracttext.png

Output:-

51409-output.png

As you can see in above output screenshot both regex matches and gives same results once we extract all the contents as attributes then you can use expression language like ${Attribute 1} to get 1096 value ..etc.

**Note**

Keep no space in attribute names like Attribute_1 instead of Attribute 1,that would be easy to retrieve attribute value inside NiFi Flow. Change the Attribute names without spaces in Extract Text Processor.

.

If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of errors.

Don't have an account?
Coming from Hortonworks? Activate your account here