Created 08-28-2017 02:20 PM
Hi Team,
I am trying to parameterize 'Search Value' & 'Replacement Value' properties in ReplaceText processor. However, I am not getting the desired result.
search_pattern - ^(.{1})(.{2})(.{18})(.{19})
replace_pattern - $1|$2|$3|$4
If I use the parameters 'search_pattern' & 'replace_pattern'(${search_pattern} & ${replace_pattern}), replace is not happening. However, if I hardcode the patterns, the search & replace is happening as expected.
Could you please help me out?
Thanks!
Created 08-28-2017 03:30 PM
To use them that way, those have to be attributes of the flow file you're passing through the ReplaceText processor.
Created 08-28-2017 04:44 PM
@Wynner
I am passing them as flow file attributes only. But still I am not able to parse it properly.
Could you please check and help me out?
Thanks in Advance!
Created 08-28-2017 05:02 PM
What is the configuration of the ReplaceText processor?
Created on 08-28-2017 05:15 PM - edited 08-17-2019 05:09 PM
ReplaceText Configuration -
where search_pattern - ^(.{1})(.{2})(.{18})(.{19}) & replace_pattern - $1|$2|$3|$4
Thanks!
Created 08-28-2017 05:32 PM
Do you have sample of text you can give you're working with?
Created 08-28-2017 05:44 PM
@Wynner
Attached the sample data. The total length of the record is 40. We are trying to convert the fixed width data to delimited data using regex.
Thanks!
Created 08-28-2017 06:24 PM
After consulting an engineer @mpayne, the way you are trying to use the attributes will not work. Attributes are treated as literals not regexes.
Created 08-29-2017 01:14 AM
Is there a way to overcome it? Any alternate way to parameterize?
Created 09-28-2017 03:49 PM
Currently there is not a way to parametrize these properties.