<?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 As long as none of the dataâ€¦ in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44402#M881</link>
    <description>As long as none of the data contains delimiters/quotes or nulls (should not apply to bp)Â&amp;nbsp;- that would do.</description>
    <pubDate>Sun, 05 May 2019 20:36:00 GMT</pubDate>
    <dc:creator>AndreyKudinov</dc:creator>
    <dc:date>2019-05-05T20:36:00Z</dc:date>
    <item>
      <title>What is the best way to paste collection into a csv file?</title>
      <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44395#M874</link>
      <description>What is the best way to paste collection into a csv file? Should I use the Word VBO?</description>
      <pubDate>Tue, 12 Feb 2019 19:52:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44395#M874</guid>
      <dc:creator>pranavred</dc:creator>
      <dc:date>2019-02-12T19:52:00Z</dc:date>
    </item>
    <item>
      <title>I would have sworn one of…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44396#M875</link>
      <description>&lt;P&gt;I would have sworn one of the default utility object had a basic action for this, but I'm not finding it. Below is the version I wrote to accept custom delimiters using c#. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inputs: &lt;BR /&gt;Collection - Collection &lt;BR /&gt;Delimiter - Text &lt;BR /&gt;Target - Text&lt;/P&gt;
&lt;PRE class="language-csharp"&gt;StringBuilder sb &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;StringBuilder&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;string&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt; columnNames &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; Collection&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Columns&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Cast&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Select&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;column &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;gt;&lt;/SPAN&gt; column&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ColumnName&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToArray&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
sb&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;AppendLine&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;string&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Join&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;Delimiter&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; columnNames&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;DataRow row &lt;SPAN class="token keyword"&gt;in&lt;/SPAN&gt; Collection&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Rows&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="token punctuation"&gt;{&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;string&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt; fields &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ItemArray&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Select&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;field &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;gt;&lt;/SPAN&gt; field&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToString&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToArray&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	sb&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;AppendLine&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;string&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Join&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;Delimiter&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; fields&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token punctuation"&gt;}&lt;/SPAN&gt;
File&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;WriteAllText&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;Target&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; sb&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToString&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Feb 2019 20:48:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44396#M875</guid>
      <dc:creator>AmiBarrett</dc:creator>
      <dc:date>2019-02-12T20:48:00Z</dc:date>
    </item>
    <item>
      <title>You talking about the…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44397#M876</link>
      <description>You talking about the Utility - Strings action 'Collection to CSV'?</description>
      <pubDate>Tue, 12 Feb 2019 22:52:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44397#M876</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2019-02-12T22:52:00Z</dc:date>
    </item>
    <item>
      <title>That sounds right - I…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44398#M877</link>
      <description>That sounds right - I changed divisions at my company a while back, which also meant changing environments. This one doesn't seem to have that action for some reason. (Not a huge loss I suppose, when we already have an alternative.)</description>
      <pubDate>Wed, 13 Feb 2019 00:29:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44398#M877</guid>
      <dc:creator>AmiBarrett</dc:creator>
      <dc:date>2019-02-13T00:29:00Z</dc:date>
    </item>
    <item>
      <title>When you can write code like…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44399#M878</link>
      <description>When you can write code like you do @amibarrett, I wouldn't feel at a loss at all not having that action. Hahah!</description>
      <pubDate>Wed, 13 Feb 2019 02:08:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44399#M878</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2019-02-13T02:08:00Z</dc:date>
    </item>
    <item>
      <title>Hahah @david.l.morris. That…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44400#M879</link>
      <description>Hahah @david.l.morris. That's exactly what I was thinking.&amp;nbsp;@amibarrett has code solutions for every problem (which is amazing)&amp;nbsp;
I figured later this question was pretty dumb as I just wanted to paste a collection in csv file. I used Excel VBO&amp;nbsp;to create instance, opened workbook, pasted the collection and closed the instance. I could use the code if there's no excel on the machine, but&amp;nbsp;it worked out.&amp;nbsp;</description>
      <pubDate>Thu, 14 Feb 2019 01:08:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44400#M879</guid>
      <dc:creator>pranavred</dc:creator>
      <dc:date>2019-02-14T01:08:00Z</dc:date>
    </item>
    <item>
      <title>Hi and nice code!
I addedâ€¦</title>
      <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44401#M880</link>
      <description>Hi and nice code!
I added this to the code object setup the inputs. When "checking" th code, it comes up with a handful of errors.
Â&amp;nbsp;
Any ideas on this one? As would like to give this ago for a problem we have.
Thanks
MoD</description>
      <pubDate>Fri, 03 May 2019 15:28:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44401#M880</guid>
      <dc:creator>MoDCore</dc:creator>
      <dc:date>2019-05-03T15:28:00Z</dc:date>
    </item>
    <item>
      <title>As long as none of the dataâ€¦</title>
      <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44402#M881</link>
      <description>As long as none of the data contains delimiters/quotes or nulls (should not apply to bp)Â&amp;nbsp;- that would do.</description>
      <pubDate>Sun, 05 May 2019 20:36:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44402#M881</guid>
      <dc:creator>AndreyKudinov</dc:creator>
      <dc:date>2019-05-05T20:36:00Z</dc:date>
    </item>
    <item>
      <title>Did you add this to anâ€¦</title>
      <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44403#M882</link>
      <description>Did you add this to an existing object? If so, is that object set up to run VB instead of C#? The above snippet is writtenÂ&amp;nbsp;in C#.</description>
      <pubDate>Tue, 07 May 2019 19:13:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44403#M882</guid>
      <dc:creator>AmiBarrett</dc:creator>
      <dc:date>2019-05-07T19:13:00Z</dc:date>
    </item>
    <item>
      <title>I have a new object setup inâ€¦</title>
      <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44404#M883</link>
      <description>I have a new object setup in C#
Copied and pasted the snippet into a new code block, I'm recieving 5 errors currently when checking the code.
Type: Error
Action: Validate
Description: Compiler error at line 1: The type or namespace name 'StringBuilder' could not be found (are you missing a using directive or an assembly reference?)
Type: Error
Action: Validate
Description: Compiler error at line 1: The type or namespace name 'StringBuilder' could not be found (are you missing a using directive or an assembly reference?)
Type: Error
Action: Validate
Description: Compiler error at line 7: 'System.Array' does not contain a definition for 'Select' and no extension method 'Select' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
Type: Error
Action: Validate
Description: Compiler error at line 2: 'System.Data.DataColumnCollection' does not contain a definition for 'Cast' and no extension method 'Cast' accepting a first argument of type 'System.Data.DataColumnCollection' could be found (are you missing a using directive or an assembly reference?)
Type: Error
Action: Validate
Description: Compiler error at line 10: The name 'File' does not exist in the current context
Â&amp;nbsp;
Any thoughts on these?
Â&amp;nbsp;</description>
      <pubDate>Wed, 08 May 2019 12:01:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44404#M883</guid>
      <dc:creator>MoDCore</dc:creator>
      <dc:date>2019-05-08T12:01:00Z</dc:date>
    </item>
    <item>
      <title>I have now resolved thisâ€¦</title>
      <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44405#M884</link>
      <description>I have now resolved this with adding in a selection of References and Namespace Imports.
Â&amp;nbsp;</description>
      <pubDate>Wed, 08 May 2019 18:01:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44405#M884</guid>
      <dc:creator>MoDCore</dc:creator>
      <dc:date>2019-05-08T18:01:00Z</dc:date>
    </item>
    <item>
      <title>FYI I've previously foundâ€¦</title>
      <link>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44406#M885</link>
      <description>FYI I've previously found this kind technique (collection -&amp;gt; object array -&amp;gt; range) to be very effective for writing large collections into Excel.
Dim xl, wb, ws As Object
wb = Microsoft.VisualBasic.GetObject(ExcelFilePathInput)
xl = wb.parent
ws = wb.WorkSheets("Sheet1")
Dim arr As Object(,) = New Object(CollectionInput.Rows.Count - 1, CollectionInput.Columns.Count - 1) {}
For r As Integer = 0 To CollectionInput.Rows.Count - 1
Â&amp;nbsp;Â&amp;nbsp; Â&amp;nbsp;Dim dr As DataRow = CollectionInput.Rows(r)
Â&amp;nbsp;Â&amp;nbsp; Â&amp;nbsp;For c As Integer = 0 To CollectionInput.Columns.Count - 1
Â&amp;nbsp;Â&amp;nbsp; Â&amp;nbsp;Â&amp;nbsp;Â&amp;nbsp; Â&amp;nbsp;arr(r, c) = dr(c)
Â&amp;nbsp;Â&amp;nbsp; Â&amp;nbsp;Next
Next
Dim c1 As Object = ws.Cells(2, 1)
Dim c2 As Object = ws.Cells(CollectionInput.Rows.Count + 1, CollectionInput.Columns.Count)
Dim rgÂ&amp;nbsp;As Object = ws.Range(c1, c2)
rg.Value = arr</description>
      <pubDate>Thu, 09 May 2019 14:57:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/What-is-the-best-way-to-paste-collection-into-a-csv-file/m-p/44406#M885</guid>
      <dc:creator>John__Carter</dc:creator>
      <dc:date>2019-05-09T14:57:00Z</dc:date>
    </item>
  </channel>
</rss>

