<?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>topic When Exporting to CSV  I'm receiving System.String[] in spreadsheet in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/When-Exporting-to-CSV-I-m-receiving-System-String-in-spreadsheet/m-p/460598#M44946</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the following PowerShell command:&amp;nbsp;&amp;nbsp;Get-NcExportRule -vserver *&amp;nbsp;&lt;/P&gt;&lt;P&gt;all the columns on the screen populate with the proper information, however when I export it to a .csv file, the columns Protocol, RoRule, RwFule and SuperUser are all populated with&amp;nbsp;System.String[].&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 11 May 2025 19:22:52 GMT</pubDate>
    <dc:creator>whf_netapp</dc:creator>
    <dc:date>2025-05-11T19:22:52Z</dc:date>
    <item>
      <title>When Exporting to CSV  I'm receiving System.String[] in spreadsheet</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/When-Exporting-to-CSV-I-m-receiving-System-String-in-spreadsheet/m-p/460598#M44946</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the following PowerShell command:&amp;nbsp;&amp;nbsp;Get-NcExportRule -vserver *&amp;nbsp;&lt;/P&gt;&lt;P&gt;all the columns on the screen populate with the proper information, however when I export it to a .csv file, the columns Protocol, RoRule, RwFule and SuperUser are all populated with&amp;nbsp;System.String[].&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 May 2025 19:22:52 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/When-Exporting-to-CSV-I-m-receiving-System-String-in-spreadsheet/m-p/460598#M44946</guid>
      <dc:creator>whf_netapp</dc:creator>
      <dc:date>2025-05-11T19:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: When Exporting to CSV  I'm receiving System.String[] in spreadsheet</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/When-Exporting-to-CSV-I-m-receiving-System-String-in-spreadsheet/m-p/461485#M45000</link>
      <description>&lt;P&gt;That's happening because those columns are arrays rather than strings (hence the curly brackets in the onscreen output) and Export-Csv doesn't know what to do with those. There are various ways to deal with that. I usually use PowerShell custom objects with the 'join' operation for columns that have arrays. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$output =&amp;nbsp;@()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$rules = Get-NcExportRule&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;foreach($rule in $rules)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;{&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;$output += [pscustomobject]@{&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 'PolicyName' = $rule.PolicyName&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 'RuleIndex' = $rule.RuleIndex&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 'ClientMatch' = $rule.ClientMatch&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;'Protocol' = $rule.Protocol -join(', ')&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; # etc.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$output | Export-Csv -Path [\path\to\.csv] -NoTypeInformation&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if 'Protocol' for a particular rule shows as '{nfs3, cifs, flexcache}' onscreen (for example), it will display as&amp;nbsp;'nfs3, cifs, flexcache' in the .csv file.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jun 2025 06:28:19 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/When-Exporting-to-CSV-I-m-receiving-System-String-in-spreadsheet/m-p/461485#M45000</guid>
      <dc:creator>HUX20002000</dc:creator>
      <dc:date>2025-06-07T06:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: When Exporting to CSV  I'm receiving System.String[] in spreadsheet</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/When-Exporting-to-CSV-I-m-receiving-System-String-in-spreadsheet/m-p/461706#M45027</link>
      <description>&lt;P&gt;Thank you very much. This worked perfectly and I learned something.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 22:23:02 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/When-Exporting-to-CSV-I-m-receiving-System-String-in-spreadsheet/m-p/461706#M45027</guid>
      <dc:creator>whf_netapp</dc:creator>
      <dc:date>2025-06-23T22:23:02Z</dc:date>
    </item>
  </channel>
</rss>

