Txt with special characters
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-12-19 11:01 PM
Hi everybody, i have to read a txt file which is in spanish, the problem here is that some words are with accent (´) which is a special character and when i read my file that character is changed by this character (�). I have tried using a schema.ini file to define a charset but it doesn't work. i hope someone of you know how to resolve this.
Thank you in advance four your help.
------------------------------
Gilberto Lopez
Senior Consultant
Indra
America/Mexico_City
------------------------------
Thank you in advance four your help.
------------------------------
Gilberto Lopez
Senior Consultant
Indra
America/Mexico_City
------------------------------
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-12-19 10:58 AM
In a similiar situation I created a new object "Read lines with encoding"
Have to supply the correct encoding to read the file.
Like EncodingName = "iso-8859-1"
The objected was based on standard action "Read lines from file" in Utility - File Management".
Here is the code in the code stage
New text input parameter
EncodingName
------------------------------
Roar Nilsen
Manager
Duit AS
Europe/Oslo
------------------------------
Have to supply the correct encoding to read the file.
Like EncodingName = "iso-8859-1"
The objected was based on standard action "Read lines from file" in Utility - File Management".
Here is the code in the code stage
' Assume success Success = True Message = "" Dim enc As System.Text.Encoding Try enc = System.Text.Encoding.GetEncoding(EncodingName) Lines = New DataTable() Lines.Columns.Add("Line", GetType(String)) Using sr As New StreamReader(File_Path, enc) EOF = False Start_Line = Math.Max(1, Start_Line) Dim line as String Dim lineNo As Integer = 0 Do line = sr.ReadLine() lineNo += 1 If line Is Nothing Then EOF = True : Exit Do If lineNo >= Start_Line Then Lines.Rows.Add(line) If lineNo = End_Line Then Exit Do Loop Until line Is Nothing Line_Count = Lines.Rows.Count End Using Catch ex As Exception Success = False Message = ex.Message End Try
New text input parameter
EncodingName
------------------------------
Roar Nilsen
Manager
Duit AS
Europe/Oslo
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-12-19 08:56 PM
Hi, i'm going to try your solution hoping it works.
Thanks a lot.
Regards
------------------------------
Gilberto Lopez
Senior Consultant
Indra
America/Mexico_City
------------------------------
Thanks a lot.
Regards
------------------------------
Gilberto Lopez
Senior Consultant
Indra
America/Mexico_City
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-01-20 01:58 PM
Hi Gilberto.
I am assuming you are using OCR functionality. If not, this is probably not useful/relevant.
However, I had a similar problem in Danish where we also have special characters, and what helped was installing the correct Tesseract language files under BluePrism folder.
Best regards
Ingrid
------------------------------
Ingrid Olsen
Configurator and proces consultant
Forca
Europe/Copenhagen
------------------------------
I am assuming you are using OCR functionality. If not, this is probably not useful/relevant.
However, I had a similar problem in Danish where we also have special characters, and what helped was installing the correct Tesseract language files under BluePrism folder.
Best regards
Ingrid
------------------------------
Ingrid Olsen
Configurator and proces consultant
Forca
Europe/Copenhagen
------------------------------
