- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to ExtractText from flow file using Nifi Processor?
- Labels:
-
Apache NiFi
Created on ‎01-17-2018 06:43 AM - edited ‎08-18-2019 12:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
SplitText
ExtractText
Please help me
Created ‎01-17-2018 10:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What exactly are you trying to achieve? It might be easiest to use one of the Record processors with a CSV reader.
Created ‎01-17-2018 10:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created on ‎01-17-2018 11:03 AM - edited ‎08-18-2019 12:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:-
(Or)
Add properties with below regex matches
Attribute 1
(.*?);
Attribute 2
.*?;(.*?);
Attribute 3
;.*?;(.*?);
Attribute 4
.*?;.*?;.*?;(.*?);
Attribute 5
.*?;.*?;.*?;.*?;(.*?);
Attribute 6
.*?;.*?;.*?;.*?;.*?;(.*)
Screenshot:-
Output:-
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.
Created ‎08-02-2021 04:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Shu_ashu Which processor do you use to get this attributes? Is it UpdateAttribute?
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.
