pushpavanthar commented on issue #3375: NIFI-5979 : enhanced ReplaceText 
processor with "Number of Occurrences" and "Occurrence offset" configurations
URL: https://github.com/apache/nifi/pull/3375#issuecomment-476474798
 
 
   Hi @ijokarumawak, thanks for reviewing.
   The requirement in the _NIFI-5979_ JIRA was just to replace the header 
values. However, I was thinking of below use-cases 
   
   1. I need to replace all occurrences of a text/regex except for the header 
and/or footer. If the content has fixed number of rows this can be achieved by 
using _Occurrence Offsets_ and _Number of Occurrences_
   2. This might be a specific use-case, but I strongly believe that many might 
come across such case. Consider a json as payload, which has "cityCode":"NYC" 
and "city":"NYC", suppose "NYC" is also present in "address" and "description" 
fields.
   ```
   {
     "cityCode": "NYC",
    "city": "NYC",
     "address": "200 W 44th St, NYC, NY 10036, USA",
     "description": "The Theater District is the teeming heart of Midtown West, 
NYC. In the pedestrian plazas of Times Square, costumed characters beckon to 
energetic crowds under the pulsing lights of towering digital billboards. 
Locals and tourists gather on the giant red staircase above the TKTS booth, 
which sells tickets to Broadway shows running at the area’s historic theaters. 
On busy 42nd Street, chain stores and restaurants abound."
   
   }
   ```
    But I chose to keep "cityCode":"NYC" and  "city":"NYC" untouched and want 
to change the rest of the occurrences of "NYC" to "New York City" where I can 
make use of _Occurrence Offsets_ . 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to