Solved Issues while reading .txt file with UTF-8-BOM encoding

stefanamihaesei

New Member
Hello,
I have a process where I'm reading some .csv files which are encoded in UTF-8-BOM. The problem is that this enconding provides some hidden symbols at the beginning of the text and it interferes with some of my actions of merging collection ( columns headers not matching because of those hidden symbols.) Is there a way to change the encoding of a file or to force blue prism to read the file in a certain encoding to avoid those hidden symbols ?
Thank you.
 

sahil_raina_91

Active Member
Hello,
I have a process where I'm reading some .csv files which are encoded in UTF-8-BOM. The problem is that this enconding provides some hidden symbols at the beginning of the text and it interferes with some of my actions of merging collection ( columns headers not matching because of those hidden symbols.) Is there a way to change the encoding of a file or to force blue prism to read the file in a certain encoding to avoid those hidden symbols ?
Thank you.

Before looking for a way to read the file differently, could you try to read the file and replace the occurrence of all hidden characters using a calculation stage with Replace([text],[hidden character],""). Is this something that will serve the purpose?
 

stefanamihaesei

New Member
Hi, thanks for the reply. Unfortunately, this does not apply for my case. I'm reading a collection from the csv file, and those hidden symbols goes into the naming of the first column. I tried to rename that collumn with an action but unfortunately this does not work. The column will look normal but it has some symbols which blue prism cannot recognize and that doesn't allow me to try to change or remove the symbols.
 

sahil_raina_91

Active Member
Hi, thanks for the reply. Unfortunately, this does not apply for my case. I'm reading a collection from the csv file, and those hidden symbols goes into the naming of the first column. I tried to rename that collumn with an action but unfortunately this does not work. The column will look normal but it has some symbols which blue prism cannot recognize and that doesn't allow me to try to change or remove the symbols.

Alright. Are you reading the CSV through Excel VBO "Get Worksheet as Collection" OR Utility File Mgmt - Get CSV as Collection ?
I can probably pinpoint the issue with Excel VBO method, and help resolve that.
If possible, could you share the csv file with sensitive data removed ?

On the other hand, https://www.soscisurvey.de/tools/view-chars.php website will show you non-printable characters that appear in your collection field.
You can copy the character from the website and use in the replace statement.
I have seen similar issue in Excel cells containing hidden characters, which I could replace easily with a Replace action in Excel VBO
 
Top