Created on 01-17-2018 06:43 AM - edited 08-18-2019 12:32 AM
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
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
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
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
@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.