如何从第一行提取数据并放入nifi中的属性? [英] How to extract data from the first line and put into the attribute in nifi?
问题描述
我想提取数据并将其放入属性中.例如数据:
I would like to extract data and put it into the attribute. For example data:
001ABC
UP1XYZ 00012564789
99120210101999999999
我只想要第一行中的 ABC 用于放入属性中.这个 ABC 可以是任何 3 到 4 个字符的字符串.我不知道如何获得它?
I want only the ABC in the first line for putting into the attribute. This ABC can be any string with 3 to 4 characters. I am not sure how can I get it?
我的流程是:GetFile ->SplitText ->提取文本 ->更新属性 ->路由文本我想在拆分文本之前,我应该放任何处理器来获得ABC吗?
My flow would be: GetFile -> SplitText -> ExrtactText -> UpdateAttribute -> RouteText I think before splitting the text, should I put any processor to get ABC?
推荐答案
为 ExtractText 添加一个新属性为 first_line = \A(.*)$
,这将创建一个新的 first_line
属性,您可以相应地对其进行进一步处理.
Add a new property to ExtractText as first_line = \A(.*)$
, this will create a new first_line
attribute, and you can further process it accordingly.
这篇关于如何从第一行提取数据并放入nifi中的属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!