<?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 Re: Code for replacing character in column values in a collection in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96037#M44417</link>
    <description>Thanks for your reply.&lt;BR /&gt;This code seems to be replacing dots in the collection field names. What I meant was the column values - Sorry if this was unclear &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Tue, 09 Feb 2021 08:18:28 GMT</pubDate>
    <dc:creator>KarinaHansen</dc:creator>
    <dc:date>2021-02-09T08:18:28Z</dc:date>
    <item>
      <title>Code for replacing character in column values in a collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96035#M44415</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Can anyone provide a code (C#), or give advise on, how to replace dot with comma (or other characters) for an entire column in a collection. I need to be able to define which column and I want to avoid looping.&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Mon, 08 Feb 2021 10:29:32 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96035#M44415</guid>
      <dc:creator>KarinaHansen</dc:creator>
      <dc:date>2021-02-08T10:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Code for replacing character in column values in a collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96036#M44416</link>
      <description>There should be an action in the stock Collection Manipulation object for Remove Dots From Headers that should help.&lt;BR /&gt;&lt;BR /&gt;In case you don't have it, this is the VB code:&lt;BR /&gt;
&lt;PRE class="language-csharp"&gt;&lt;CODE&gt;For Each Column As DataColumn In Input_Collection.Columns
   Column.ColumnName=Microsoft.Visualbasic.Replace(Column.ColumnName,".","")
Next
Output_Collection = Input_Collection​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;And the C# version of it:&lt;/P&gt;
&lt;PRE class="language-csharp"&gt;&lt;CODE&gt;foreach (DataColumn col in Input_Collection.Columns) {
	col.ColumnName = col.ColumnName.Replace(".", "");
}
Output_Collection = Input_Collection;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Feb 2021 18:22:51 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96036#M44416</guid>
      <dc:creator>NicholasZejdlik</dc:creator>
      <dc:date>2021-02-08T18:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Code for replacing character in column values in a collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96037#M44417</link>
      <description>Thanks for your reply.&lt;BR /&gt;This code seems to be replacing dots in the collection field names. What I meant was the column values - Sorry if this was unclear &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 09 Feb 2021 08:18:28 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96037#M44417</guid>
      <dc:creator>KarinaHansen</dc:creator>
      <dc:date>2021-02-09T08:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Code for replacing character in column values in a collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96038#M44418</link>
      <description>&lt;SPAN style="font-size: 10pt"&gt;Hi Karina,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt"&gt;Since you mentioned you want to be able to modify all rows for one specific column, this code should work.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt"&gt;foreach(DataRow row in inputCollection.Rows)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt"&gt;&amp;nbsp; &amp;nbsp; row[columnName] = row[columnName].ToString().Replace(".",",");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt"&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt"&gt;outputCollection = inputCollection;&lt;/SPAN&gt;</description>
      <pubDate>Tue, 09 Feb 2021 14:01:45 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96038#M44418</guid>
      <dc:creator>NickLeGuerrier</dc:creator>
      <dc:date>2021-02-09T14:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Code for replacing character in column values in a collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96039#M44419</link>
      <description>Thanks Nick,&amp;nbsp;&lt;BR /&gt;I see that you replied in the other thread as well &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I get this error when I try to define columnName as input and run it:&lt;BR /&gt;&lt;BR /&gt;Internal : Could not execute code stage because exception thrown by code stage: Unable to cast object of type 'System.Data.DataColumn' to type 'System.Data.DataRow'.</description>
      <pubDate>Tue, 09 Feb 2021 14:37:39 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96039#M44419</guid>
      <dc:creator>KarinaHansen</dc:creator>
      <dc:date>2021-02-09T14:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Code for replacing character in column values in a collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96040#M44420</link>
      <description>It works now - There was a mistake in line 1.&lt;BR /&gt;&lt;BR /&gt;Had it saying:
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;foreach(DataRow row in inputCollection.Columns)​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;instead of:&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;foreach(DataRow row in inputCollection.Rows)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Thank you very much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 14:48:18 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Code-for-replacing-character-in-column-values-in-a-collection/m-p/96040#M44420</guid>
      <dc:creator>KarinaHansen</dc:creator>
      <dc:date>2021-02-09T14:48:18Z</dc:date>
    </item>
  </channel>
</rss>

