<?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: Sandbox HDF Nifi: How do I convert TSV files to CSV? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sandbox-HDF-Nifi-How-do-I-convert-TSV-files-to-CSV/m-p/202323#M76894</link>
    <description>&lt;P&gt;Hi, I would suggest to use the Record reader / writer processors. You can read using a CSVRecordReader (can specify tab as the delimiter) and then use ConverRecord to convert to another schema. you have to define a schema for the records though in avro format.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Apr 2018 19:30:24 GMT</pubDate>
    <dc:creator>Avi</dc:creator>
    <dc:date>2018-04-05T19:30:24Z</dc:date>
    <item>
      <title>Sandbox HDF Nifi: How do I convert TSV files to CSV?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sandbox-HDF-Nifi-How-do-I-convert-TSV-files-to-CSV/m-p/202322#M76893</link>
      <description>&lt;P&gt;Currently I have a dataflow with the GetFile processor that taps into a directory path with TSV files.  I want to convert these TSV files to CSV for later work using the ConvertCSVToAvro processor. I've created this python script with a .bash wrapper to test it:&lt;/P&gt;&lt;PRE&gt;import sys
import csv
 
tsvin = csv.reader(sys.stdin, dialect=csv.excel_tab)
commaout = csv.writer(sys.stdout, dialect=csv.excel)
for row in tsvin:
   commaout.writerow(row)
&lt;/PRE&gt;&lt;P&gt;bash wrapper&lt;/P&gt;&lt;PRE&gt;for file in *.tsv
do
    python tsv2csv.py &amp;lt; $file &amp;gt; ${file%.*}.csv
done
&lt;/PRE&gt;&lt;P&gt;I see the ExecuteScript processor as a possible option. How would I use it to execute this python script--would the processor know where to import from for example...or is there a better way to convert? &lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 23:13:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sandbox-HDF-Nifi-How-do-I-convert-TSV-files-to-CSV/m-p/202322#M76893</guid>
      <dc:creator>paula_ditallo</dc:creator>
      <dc:date>2018-04-04T23:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sandbox HDF Nifi: How do I convert TSV files to CSV?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sandbox-HDF-Nifi-How-do-I-convert-TSV-files-to-CSV/m-p/202323#M76894</link>
      <description>&lt;P&gt;Hi, I would suggest to use the Record reader / writer processors. You can read using a CSVRecordReader (can specify tab as the delimiter) and then use ConverRecord to convert to another schema. you have to define a schema for the records though in avro format.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 19:30:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sandbox-HDF-Nifi-How-do-I-convert-TSV-files-to-CSV/m-p/202323#M76894</guid>
      <dc:creator>Avi</dc:creator>
      <dc:date>2018-04-05T19:30:24Z</dc:date>
    </item>
  </channel>
</rss>

