<?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: XSL to CSV using NiFi in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154337#M48931</link>
    <description>&lt;P&gt;  i guess based on your comment, use replacetext processor to replace all occurrence of | with ,.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Dec 2016 14:16:54 GMT</pubDate>
    <dc:creator>knarayanan</dc:creator>
    <dc:date>2016-12-15T14:16:54Z</dc:date>
    <item>
      <title>XSL to CSV using NiFi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154333#M48927</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;Is there any process where i can make my XSL File to CSV File?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 13:41:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154333#M48927</guid>
      <dc:creator>regie_canada</dc:creator>
      <dc:date>2016-12-15T13:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: XSL to CSV using NiFi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154334#M48928</link>
      <description>&lt;P&gt;  Convert xsl to json using this&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/articles/29474/nifi-converting-xml-to-json.html" target="_blank"&gt;https://community.hortonworks.com/articles/29474/nifi-converting-xml-to-json.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and then convert json to csv using this&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/sunileman/NiFi-Json2Csv" target="_blank"&gt;https://github.com/sunileman/NiFi-Json2Csv&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 13:46:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154334#M48928</guid>
      <dc:creator>sunile_manjee</dc:creator>
      <dc:date>2016-12-15T13:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: XSL to CSV using NiFi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154335#M48929</link>
      <description>&lt;P&gt;@regie canada you want to convert XSL to CSV? just wanting to confirm you didn't mean XLS.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 14:00:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154335#M48929</guid>
      <dc:creator>knarayanan</dc:creator>
      <dc:date>2016-12-15T14:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: XSL to CSV using NiFi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154336#M48930</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/10180/knarayanan.html" nodeid="10180"&gt;@Karthik Narayanan&lt;/A&gt;&lt;P&gt;Hi sir, yes it is XSL. We made a program that will turn our XML to XSL.&lt;/P&gt;&lt;P&gt;This is the current sample output:&lt;/P&gt;&lt;P&gt;1000002746|CRl Campbell|905-899-3495|905-899-3495|lrobert@crlcampbell.com|11675 Burnaby Rd ||Wainfleet|province-ONTA|L0S1V0|Active|HostedIPV_1000003883_SA&lt;/P&gt;&lt;P&gt;We use PIPE for delimiter.&lt;/P&gt;&lt;P&gt;and now I need to make it csv so i can convert it to json.&lt;/P&gt;&lt;P&gt;Thank.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 14:11:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154336#M48930</guid>
      <dc:creator>regie_canada</dc:creator>
      <dc:date>2016-12-15T14:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: XSL to CSV using NiFi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154337#M48931</link>
      <description>&lt;P&gt;  i guess based on your comment, use replacetext processor to replace all occurrence of | with ,.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 14:16:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154337#M48931</guid>
      <dc:creator>knarayanan</dc:creator>
      <dc:date>2016-12-15T14:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: XSL to CSV using NiFi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154338#M48932</link>
      <description>&lt;P&gt;
	you may need header information to convert this to json, technically even the xsl output you have is CSV, just delimited with pipe. I think you can directly use the executescript processor, to call a python script, and go from xsl to json..&lt;/P&gt;&lt;P&gt;
	getfile (read the file with xsl data ) -&amp;gt; splittext (split the data into lines )--&amp;gt;execute script (with script below to convert to json) --&amp;gt; merge content (merge contents based on fragment.identifier attribute of split text) --&amp;gt; put file (gives you json files )&lt;/P&gt;&lt;P&gt;
	--- example scrip for converting to json..&lt;/P&gt;&lt;PRE&gt;import json
import java.io
from org.apache.commons.io import IOUtils
from java.nio.charset import StandardCharsets
from org.apache.nifi.processor.io import StreamCallback


class PyStreamCallback(StreamCallback):
  def __init__(self):
        pass
  def process(self, inputStream, outputStream):
    header=["column1","column2","column3"...] # the header for the xsl, this will become the name for json nodes
    text = IOUtils.toString(inputStream, StandardCharsets.UTF_8)
    output={}
    for column in text.split("|"):
	index=0 # counter to keep track of column, so we can assing a name to the value.
	output[header(index)]=column
	outputStream.write(bytearray(json.dumps(output, indent=4).encode('utf-8')))	
flowFile = session.get()
if (flowFile != None):
  flowFile = session.write(flowFile,PyStreamCallback())
  flowFile = session.putAttribute(flowFile, "filename", flowFile.getAttribute('filename').split('.')[0]+'_translated.json')
  session.transfer(flowFile, REL_SUCCESS)

&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Dec 2016 14:36:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154338#M48932</guid>
      <dc:creator>knarayanan</dc:creator>
      <dc:date>2016-12-15T14:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: XSL to CSV using NiFi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154339#M48933</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/10180/knarayanan.html" nodeid="10180"&gt;@Karthik Narayanan&lt;/A&gt;&lt;P&gt;Thank you so much for answering.&lt;/P&gt;&lt;P&gt;Do I need to install anything to run a python script?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 14:56:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154339#M48933</guid>
      <dc:creator>regie_canada</dc:creator>
      <dc:date>2016-12-15T14:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: XSL to CSV using NiFi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154340#M48934</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14397/regiecanada.html" nodeid="14397"&gt;@regie canada&lt;/A&gt; no you dont have to, it should work out of the box.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 23:42:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154340#M48934</guid>
      <dc:creator>knarayanan</dc:creator>
      <dc:date>2016-12-15T23:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: XSL to CSV using NiFi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154341#M48935</link>
      <description>&lt;P&gt;You can also try this NIFI groovy processor that converts XML to CSV&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer noopener noreferrer" href="https://github.com/maxbback/nifi-xml" target="_blank"&gt;https://github.com/maxbback/nifi-xml&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Feb 2019 18:58:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/XSL-to-CSV-using-NiFi/m-p/154341#M48935</guid>
      <dc:creator>max_boreback</dc:creator>
      <dc:date>2019-02-23T18:58:53Z</dc:date>
    </item>
  </channel>
</rss>

