You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Ashraf Hasson <AH...@WindMobile.ca> on 2016/05/16 17:30:46 UTC

ReplaceText processor - regex search and replace text captured

Hi everyone,


I'm trying to replace a specific character in a file which occurs on the first line only but can't seem to figure it out, here are the details of ReplaceText processor I'm using:


Search Value: (?s:"% '('Effective Bytes',' Network Bytes')'"$)

Replacement Value: ${'$1':replace(',','-')}

Replacement Strategy: Literal Replace

Evaluation Mode: Line-by-line


The output is sent to PutHDFS but the file content are not changed! I've tried other variations of the above regex to no avail. I'd really appreciate any help please.


Thanks,

Re: ReplaceText processor - regex search and replace text captured

Posted by Bryan Bende <bb...@gmail.com>.
Hi Ashraf,

Could you supply an example of the first line of input and explain what
you'd like to replace?

It would be helpful to determine the appropriate search value.

-Bryan

On Mon, May 16, 2016 at 1:30 PM, Ashraf Hasson <AH...@windmobile.ca>
wrote:

> Hi everyone,
>
>
> I'm trying to replace a specific character in a file which occurs on the
> first line only but can't seem to figure it out, here are the details of
> ReplaceText processor I'm using:
>
>
> Search Value: (?s:"% '('Effective Bytes',' Network Bytes')'"$)
>
> Replacement Value: ${'$1':replace(',','-')}
>
> Replacement Strategy: Literal Replace
>
> Evaluation Mode: Line-by-line
>
>
> The output is sent to PutHDFS but the file content are not changed! I've
> tried other variations of the above regex to no avail. I'd really
> appreciate any help please.
>
>
> Thanks,
>