<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: how  can i replace ',' with new line in replacetext  processor in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185229#M147336</link>
    <description>&lt;P&gt;thank  you , your  answer  was  very  helpful  &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; &lt;/P&gt;</description>
    <pubDate>Sat, 16 Sep 2017 14:13:17 GMT</pubDate>
    <dc:creator>salome_tkhilais</dc:creator>
    <dc:date>2017-09-16T14:13:17Z</dc:date>
    <item>
      <title>how  can i replace ',' with new line in replacetext  processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185224#M147331</link>
      <description>&lt;P&gt;I want to parse json response in nifi processor I have json data like this  ,I have already used this expression inside evaluatejsonpath processor : &lt;STRONG&gt;$.Data['row']&lt;/STRONG&gt; and thanks to it i got row data then i have used another expression inside replacetext processor: &lt;STRONG&gt;[]&lt;/STRONG&gt; to get rid of this '[]' &lt;STRONG&gt;but i can't replace ',' with new line how can i do this?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;{"squadName":"Super hero squad","homeTown":"Metro City","formed":2016,"secretBase":"Super tower","active":true,"Data":{"row":[{"name":"Molecule Man","age":29,"secretIdentity":"Dan Jukes","powers":["Radiation resistance","Turning tiny","Radiation blast"]},{"name":"Madame Uppercut","age":39,"secretIdentity":"Jane Wilson","powers":["Million tonne punch","Damage resistance","Superhuman reflexes"]},{"name":"Eternal Flame","age":1000000,"secretIdentity":"Unknown","powers":["Immortality","Heat Immunity","Inferno","Teleportation","Interdimensional travel"]}]} &lt;/P&gt;&lt;P&gt;and i want totransform it into this format:&lt;/P&gt;&lt;PRE&gt;&amp;lt;code&amp;gt;{"name":"Molecule Man","age":29,"secretIdentity":"Dan Jukes","powers":["Radiation resistance","Turning tiny","Radiation blast"]}{name": "MoleculeMan", "age": 29,  "secretIdentity": "DanJukes", "powers":  ["Radiation resistance", "Turning tiny", "Radiation blast"]}
   {"name": "MoleculeMan", "age": 29,  "secretIdentity": "DanJukes", "powers":  ["Radiation resistance", "Turning tiny", "Radiation blast"]}&lt;/PRE&gt;&lt;PRE&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Sep 2017 15:47:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185224#M147331</guid>
      <dc:creator>salome_tkhilais</dc:creator>
      <dc:date>2017-09-15T15:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: how  can i replace ',' with new line in replacetext  processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185225#M147332</link>
      <description>&lt;P&gt;To  sum   up i  want  to replace   ','  after  }  with  \n&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 16:08:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185225#M147332</guid>
      <dc:creator>salome_tkhilais</dc:creator>
      <dc:date>2017-09-15T16:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: how  can i replace ',' with new line in replacetext  processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185226#M147333</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/30155/salometkhilaishvili.html" nodeid="30155" target="_blank"&gt;@sally sally&lt;/A&gt;,&lt;BR /&gt;as you said you are getting rid of [] in the flow file content but in my case i haven't get rid of [] you can use your existing functionality. After that use another replace text processor with&lt;STRONG&gt; search value property&lt;/STRONG&gt; as &lt;/P&gt;&lt;PRE&gt;(?&amp;lt;=]})(,)&lt;/PRE&gt;&lt;P&gt;if you are having any spaces or new line characters before , then make use of below regex&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;(?&amp;lt;=]})(\s*,)&lt;/PRE&gt;&lt;P&gt;and &lt;STRONG&gt;replacement value property &lt;/STRONG&gt;as &lt;/P&gt;&lt;PRE&gt;shift+enter&lt;/PRE&gt;
it will replaces your , after } with new line
&lt;P&gt;&lt;STRONG&gt;Input:-&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;   {
"squadName": "Super hero squad",
"homeTown": "Metro City",
"formed": 2016,
"secretBase": "Super tower",
"active": true,
"Data": {
"row": [{
"name": "Molecule Man",
"age": 29,
"secretIdentity": "Dan Jukes",
"powers": ["Radiation resistance",
"Turning tiny",
"Radiation blast"]
},
{
"name": "Madame Uppercut",
"age": 39,
"secretIdentity": "Jane Wilson",
"powers": ["Million tonne punch",
"Damage resistance",
"Superhuman reflexes"]
},
{
"name": "Eternal Flame",
"age": 1000000,
"secretIdentity": "Unknown",
"powers": ["Immortality",
"Heat Immunity",
"Inferno",
"Teleportation",
"Interdimensional travel"]
}]
}}&lt;/PRE&gt;
&lt;STRONG&gt;Output:-&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE&gt;[{"name":"Molecule Man","age":29,"secretIdentity":"Dan Jukes","powers":["Radiation resistance","Turning tiny","Radiation blast"]}
{"name":"Madame Uppercut","age":39,"secretIdentity":"Jane Wilson","powers":["Million tonne punch","Damage resistance","Superhuman reflexes"]} {"name":"Eternal Flame","age":1000000,"secretIdentity":"Unknown","powers":["Immortality","Heat Immunity","Inferno","Teleportation","Interdimensional travel"]}]&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Replacetext configs:-&lt;/STRONG&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="38656-replacetext-config.png" style="width: 799px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18905i42E73941A0CC2D1A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="38656-replacetext-config.png" alt="38656-replacetext-config.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In addition &lt;/STRONG&gt;&lt;BR /&gt;in future if you are expecting different flow files for each record make a use splitJson processor with &lt;BR /&gt;JsonPath Expression property as $.Data.row&lt;/P&gt;&lt;P&gt;connect the split property to another processor, it will results as in our array of data.row having 3 records so it will results 3 different flow files as a result from split json processor.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="38657-splijson.png" style="width: 696px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18906iFE119421CDD322A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="38657-splijson.png" alt="38657-splijson.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Results after splitjson configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="38658-splitjson-result.png" style="width: 561px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18907iAA6A56BE02EAA1DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="38658-splitjson-result.png" alt="38658-splitjson-result.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output:-  &lt;/STRONG&gt; as we are having 3 flow files above and the contents of those flowfiles as follows.&lt;BR /&gt;&lt;STRONG&gt;flowfile1:-&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{"name":"Eternal Flame","age":1000000,"secretIdentity":"Unknown","powers":["Immortality","Heat Immunity","Inferno","Teleportation","Interdimensional travel"]}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;flowfile2:-&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{"name":"Molecule Man","age":29,"secretIdentity":"Dan Jukes","powers":["Radiation resistance","Turning tiny","Radiation blast"]}flowfile3:-&lt;/PRE&gt;
&lt;STRONG&gt;flowfile3:-&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE&gt;{"name":"Madame Uppercut","age":39,"secretIdentity":"Jane Wilson","powers":["Million tonne punch","Damage resistance","Superhuman reflexes"]}&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Aug 2019 08:24:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185226#M147333</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T08:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: how  can i replace ',' with new line in replacetext  processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185227#M147334</link>
      <description>&lt;P&gt;thank   you  for    your  address , Do  you know  how can i  replace  "[{ ......}]  with  { .....}  in replacte text i have  tried  this  [\[\]](\{|\})   but  it  can  annly remove  first  [ and  leavs    ]  at the  and  of  json data  reuqest&lt;/P&gt;</description>
      <pubDate>Sat, 16 Sep 2017 01:34:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185227#M147334</guid>
      <dc:creator>salome_tkhilais</dc:creator>
      <dc:date>2017-09-16T01:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: how  can i replace ',' with new line in replacetext  processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185228#M147335</link>
      <description>&lt;P&gt;In Replace Text Processor&lt;BR /&gt;set &lt;STRONG&gt;Search Value property&lt;/STRONG&gt; as &lt;/P&gt;&lt;PRE&gt;^\[(.*)\]$&lt;/PRE&gt;&lt;P&gt;it will captures all the data except [] into group 1 then use &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Replacement Value&lt;/STRONG&gt; property as &lt;/P&gt;&lt;PRE&gt;$1&lt;/PRE&gt;&lt;P&gt;as a result from replace text processor you can get all the data except [] as a new replacement of the content.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;screenshots of configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="40381-replacetext-confs.png" style="width: 772px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18904iE21A13063A0A3C26/image-size/medium?v=v2&amp;amp;px=400" role="button" title="40381-replacetext-confs.png" alt="40381-replacetext-confs.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Input to Replace Text:- &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[{"name":"Molecule Man","age":29,"secretIdentity":"Dan Jukes","powers":["Radiation resistance","Turning tiny","Radiation blast"]},{"name":"Madame Uppercut","age":39,"secretIdentity":"Jane Wilson","powers":["Million tonne punch","Damage resistance","Superhuman reflexes"]},{"name":"Eternal Flame","age":1000000,"secretIdentity":"Unknown","powers":["Immortality","Heat Immunity","Inferno","Teleportation","Interdimensional travel"]}]&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Output after Replace Text:-&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{"name":"Molecule Man","age":29,"secretIdentity":"Dan Jukes","powers":["Radiation resistance","Turning tiny","Radiation blast"]},{"name":"Madame Uppercut","age":39,"secretIdentity":"Jane Wilson","powers":["Million tonne punch","Damage resistance","Superhuman reflexes"]},{"name":"Eternal Flame","age":1000000,"secretIdentity":"Unknown","powers":["Immortality","Heat Immunity","Inferno","Teleportation","Interdimensional travel"]}&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Aug 2019 08:24:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185228#M147335</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T08:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: how  can i replace ',' with new line in replacetext  processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185229#M147336</link>
      <description>&lt;P&gt;thank  you , your  answer  was  very  helpful  &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Sat, 16 Sep 2017 14:13:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-can-i-replace-with-new-line-in-replacetext-processor/m-p/185229#M147336</guid>
      <dc:creator>salome_tkhilais</dc:creator>
      <dc:date>2017-09-16T14:13:17Z</dc:date>
    </item>
  </channel>
</rss>

