<?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: Import CSV in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72732#M25337</link>
    <description>Hi!&amp;nbsp;&lt;BR /&gt;First I use &lt;STRONG&gt;Get Files&lt;/STRONG&gt; action of &lt;STRONG&gt;Utility - File Management &lt;/STRONG&gt;and then&lt;STRONG&gt; Get CSV Text as a Collection. &lt;/STRONG&gt;In that collection is where i get the "0" instead of the "R". I´ll attach a picture of the data in excel as I think this is where the problem arises but my client cannot make changes to it so all i have left is to try fix it in BP.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Agustina Diaz Casas&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Mon, 30 May 2022 20:50:00 GMT</pubDate>
    <dc:creator>AgustinaDiaz_Ca</dc:creator>
    <dc:date>2022-05-30T20:50:00Z</dc:date>
    <item>
      <title>Import CSV</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72730#M25335</link>
      <description>&lt;SPAN&gt;I'm importing a CSV file using a comma delimiter, which works successfully. However, when i use "Get CSV text as a Collection" the data that contains a "R" value its transformed to "0" during import. How can I change this?&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cuando uso la acción &lt;SPAN&gt; "Get CSV text as a Collection" me escribe las R como 0. Este input se encuentra separado entre comas nada mas. Como hago para que escriba en la collection R y no 0?&lt;/SPAN&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Agustina Diaz Casas&lt;BR /&gt;------------------------------</description>
      <pubDate>Mon, 30 May 2022 18:36:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72730#M25335</guid>
      <dc:creator>AgustinaDiaz_Ca</dc:creator>
      <dc:date>2022-05-30T18:36:00Z</dc:date>
    </item>
    <item>
      <title>RE: Import CSV</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72731#M25336</link>
      <description>Hi Augustina,&lt;BR /&gt;&lt;BR /&gt;I suspect the issue might not be at 'Get CSV Text As Collection' action but maybe even before that when you are actually reading the text from the CSV file itself.&lt;BR /&gt;&lt;BR /&gt;Can you check couple of things at your end:&lt;BR /&gt;&lt;BR /&gt;1) Which action are you using for reading the CSV text from the file? Is it '&lt;STRONG&gt;Read All Text From File&lt;/STRONG&gt;' action of '&lt;STRONG&gt;Utility - File Management&lt;/STRONG&gt;' Business Object ?&lt;BR /&gt;&lt;BR /&gt;2) Is this same issue of 'R' getting replaced by '0' happening in the Text data item which is holding the entire CSV content when you read the CSV file. Just try to step in before '&lt;STRONG&gt;Get CSV Text As Collection&lt;/STRONG&gt;' action and check what is the current value of the input data item to this action. Let us know if there only you are getting this issue itself or not ?&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the '&lt;STRONG&gt;Best Answer&lt;/STRONG&gt;' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 30 May 2022 20:16:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72731#M25336</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-05-30T20:16:00Z</dc:date>
    </item>
    <item>
      <title>RE: Import CSV</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72732#M25337</link>
      <description>Hi!&amp;nbsp;&lt;BR /&gt;First I use &lt;STRONG&gt;Get Files&lt;/STRONG&gt; action of &lt;STRONG&gt;Utility - File Management &lt;/STRONG&gt;and then&lt;STRONG&gt; Get CSV Text as a Collection. &lt;/STRONG&gt;In that collection is where i get the "0" instead of the "R". I´ll attach a picture of the data in excel as I think this is where the problem arises but my client cannot make changes to it so all i have left is to try fix it in BP.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Agustina Diaz Casas&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 30 May 2022 20:50:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72732#M25337</guid>
      <dc:creator>AgustinaDiaz_Ca</dc:creator>
      <dc:date>2022-05-30T20:50:00Z</dc:date>
    </item>
    <item>
      <title>RE: Import CSV</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72733#M25338</link>
      <description>Hi Augustina,&lt;BR /&gt;&lt;BR /&gt;Thanks for clarifying the exact action name. I think the issue is because you are using the action '&lt;STRONG&gt;Get CSV Text As&amp;nbsp; A Collection&lt;/STRONG&gt;' from '&lt;STRONG&gt;Utility - File Management&lt;/STRONG&gt;' business object. This business object uses OLEDB operation in the back end to connect to your CSV file and treat it as a database. The issue here lies with the formatting of your file. Since, it is SQL based query if you do not internally cast the column at the point where you are firing the query the format changes won't appear. In your case, I guess that the code stage used in this action is treating your column as a 'Number' and that is the reason when you put a character such as 'R' it is not treated properly.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Replicating The Issue:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;I can show you a similar result I performed on a test CSV file and in my case also, 'R' won't be treated properly. The only difference is I am not getting 0 but null values instead.&lt;BR /&gt;&lt;BR /&gt;As you can see, I have the below CSV file with me:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="22181.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/22318i31972276EA4C9358/image-size/large?v=v2&amp;amp;px=999" role="button" title="22181.png" alt="22181.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;When I try to use a similar workflow as you have used this is the result I got:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="22182.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/22322iEAA8A637D3AA0647/image-size/large?v=v2&amp;amp;px=999" role="button" title="22182.png" alt="22182.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Making changes to the underlying code in this object might be bit tricky as OLEDB queries in general have a very limited set of formatting available with them.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Solution:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;So instead, you can use a separate set of actions which I have used to get the same result as you expect:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="22183.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/22325i7F1040CF6DB35B25/image-size/large?v=v2&amp;amp;px=999" role="button" title="22183.png" alt="22183.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;So here I am using first the '&lt;STRONG&gt;Read All Text From File&lt;/STRONG&gt;' action in the&lt;STRONG&gt; 'Utility - File Management&lt;/STRONG&gt;' VBO itself which will return me a text data item with the exact text content as shown below:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="22184.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/22328iB6C7D3C6EDD871A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="22184.png" alt="22184.png" /&gt;&lt;/span&gt;Once, you get this text data item, then simply use the&amp;nbsp; 'Get CSV As Collection' action from 'Utility - Strings' business object where you can pass the text data item and store the result in a collection:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="22185.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/22329iCE71AE204127B55C/image-size/large?v=v2&amp;amp;px=999" role="button" title="22185.png" alt="22185.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Conclusion:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;This approach won't ideally fail as when we use the '&lt;STRONG&gt;Read All Text From File&lt;/STRONG&gt;' action, we are using the &lt;STRONG&gt;StreamReader&lt;/STRONG&gt; class from &lt;STRONG&gt;System.IO&lt;/STRONG&gt; namespace that directly reads all your text content as bytes and by default applies the encoding of 'UTF-8' which will handle most of the character formats unlike the OLEDB approach where formatting can be a constraint. The only advantage that OLEDB approach which you are using right now has would be the speed of execution and handling of very large text files.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 30 May 2022 22:34:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72733#M25338</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-05-30T22:34:00Z</dc:date>
    </item>
    <item>
      <title>RE: Import CSV</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72734#M25339</link>
      <description>This worked great but i cant loop the collection later on in the process, is it because i dont have collection fields?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;On the other hand, when i use "Read text from file" the Data doesnt recognize "ñ" or words with an accent mark, so if i try to use the old collection to store this data i cant, because it already has fields that doesnt match. Ill attach everything, hopefully you understand.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Agustina Diaz Casas&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 31 May 2022 16:58:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72734#M25339</guid>
      <dc:creator>AgustinaDiaz_Ca</dc:creator>
      <dc:date>2022-05-31T16:58:00Z</dc:date>
    </item>
    <item>
      <title>RE: Import CSV</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72735#M25340</link>
      <description>Hi Augustina,&lt;BR /&gt;&lt;BR /&gt;For the special character not being read properly issue, you can go inside the '&lt;STRONG&gt;File Management&lt;/STRONG&gt;' business object and go to the action '&lt;STRONG&gt;Read All Text From File&lt;/STRONG&gt;' and then in the code stage make the modification which I have highlighted once:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;NOTE: I would recommend to create a duplicate copy of the File Management business object and make the changes there and use that so that you don't mess up the original business object if it used by some other bot in your environment.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="22192.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/22337i14D0232B270CF520/image-size/large?v=v2&amp;amp;px=999" role="button" title="22192.png" alt="22192.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Your updated code should look like below:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-vbnet"&gt;&lt;CODE&gt;Try
   If File.Exists(File_Name) Then
   	Dim sr As New StreamReader(File_Name,System.Text.Encoding.ASCII)
   	Text = sr.ReadToEnd
   	sr.Close()
   	Success = True
   	Message = ""
   Else
      Throw New ApplicationException("The file at " &amp;amp; File_Name &amp;amp; " does not exist")
   End If
Catch e As Exception
	Success = False
	Message = e.Message
End Try​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;Here, I have just added an extra parameter called as '&lt;CODE&gt;System.Text.Encoding.ASCII&lt;/CODE&gt;' which will try to change the encoding format while reading your text file so that other special characters can be recognized.&lt;BR /&gt;&lt;BR /&gt;For the other issue related to the loop part, no that most likely won't be the case because what we are getting right now is an undefined collection in contrast to what you had previously with you called as a defined collection. No matter what type of collection we have, looping should be possible as long as you have rows in that collection and if you are using the correct 'Collection Name' in your loop stage. Since the names of your collection are identical the old one and the new one it might be the case that why is it take an incorrect collection. I would first suggest to check the names and make them clearly distinct from each other. &lt;BR /&gt;&lt;BR /&gt;Next, are you using a loop stage to iterate within the collection? If yes, check if you have supplied the correct collection name to it. If no, then are you using a decision stage to control the index of rows in your collection and using that to iterate?&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;WonderBotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 31 May 2022 18:27:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72735#M25340</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-05-31T18:27:00Z</dc:date>
    </item>
    <item>
      <title>RE: Import CSV</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72736#M25341</link>
      <description>Hi everyone!&lt;BR /&gt;&lt;BR /&gt;I love this kind of spanish problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Just add to the Devneet's explanation, when you "translate" the encoding from a file from one to other, this may cause some characters to be "lost". When I need to read text, usually we use the UTF-8 encoding. If you are not pretty sure of with encoding you have in the file, or problably have a lot of types, you can use the encoding default.&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-vbnet" tabindex="0"&gt;&lt;CODE&gt;System.Text.Encoding.Default​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;Hope this helps you!!&lt;BR /&gt;&lt;BR /&gt;See you in the Community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Pablo Sarabia&lt;BR /&gt;Solution Manager &amp;amp; Architect&lt;BR /&gt;Altamira Assets Management&lt;BR /&gt;Madrid&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Jun 2022 06:20:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72736#M25341</guid>
      <dc:creator>PabloSarabia</dc:creator>
      <dc:date>2022-06-01T06:20:00Z</dc:date>
    </item>
    <item>
      <title>RE: Import CSV</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72737#M25342</link>
      <description>Hola Pablo!&lt;BR /&gt;This is what ended up working for me, muchas gracias!!&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Agustina Diaz Casas&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Jun 2022 18:04:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Import-CSV/m-p/72737#M25342</guid>
      <dc:creator>AgustinaDiaz_Ca</dc:creator>
      <dc:date>2022-06-01T18:04:00Z</dc:date>
    </item>
  </channel>
</rss>

