Read text activity is not working in Text

when I’m reading text file using Read Text activity, so data is not reading same.

Input data in Text file - ISA00 00 089258130000 089262950DSD 2501220902U004010000104550P>…
GSOG9085273379617887300120250122090210192T004010UCS…
ST875000058202…
G50N20250122*12054330…
N9DP62…
G62022025012430000…
G66MZZ…
**G23
013*1030…
**N1
STS/R TRI CITY PLAZA90069724180350…**
**N3
35-TALCOTTVILLE RD…**
N4VERNONCT*060660000…
N1VNHP HOOD EFT9001008697…
N1BTWAKEFRN FOOD90069724180000…
G6816CA4.08004410010320PI620000262…
G69*HVD GALLON…
G687CA2.17004410010189PI620000264…

so when I’m reading using Read text activity so at the end of each line data is converting (�) instead of (…)

Output Data - ISA00 00 089258130000 089262950DSD 2501220902U004010000104550P>�
GSOG9085273379617887300120250122090210192T004010UCS�
ST875000058202�
G50N2025012212054330�
N9
DP62�
G62
022025012430000�
G66M
ZZ�
G23013***1030�
N1STS/R TRI CITY PLAZA90069724180350�
N335-TALCOTTVILLE RD�
N4
VERNONCT060660000�
N1VNHP HOOD EFT9001008697�
N1BTWAKEFRN FOOD90069724180000�
G6816CA4.08004410010320PI620000262�
G69HVD GALLON�
G68
7CA2.17004410010189PI*620000264�

Please help me how can I solve this issue?
Input file
Text File Data.txt (580 Bytes)

Hi,

For now, can you try to set “UTF-8” at encoding property as the following?

Regards,

1 Like

Hi @Ankit_Chauhan

Have you enforced an encoding type? could you check the properties

Hi @Ankit_Chauhan

In the read text file activity property just change Encoding = UTF-8

Happy Automation

I have tried the same Encoding “UTF-8” but not working.

can you please help me again?

Hi,

To isolate cause, can you try to run the following sample in your environment?

Sample
Sample20250327-3.zip (3.1 KB)

Regards,

Hi @Ankit_Chauhan

Based on the presence of special characters like … in input text file you sent, instead of , it seems like the file was originally encoded in Windows-1252 (ANSI) or ISO-8859-1, but it is being misinterpreted as UTF-8 when read.

Try setting the Encoding property in the Read Text File activity to:
iso-8859-1

Alternatively, if that doesn’t work, try:
windows-1252

Can you try this

Hi @Ankit_Chauhan

Try this Encoding:
System.Text.Encoding.GetEncoding(“windows-1252”)

fileContent = System.IO.File.ReadAllText(“C:\path\to\your\file.txt”, System.Text.Encoding.UTF8)

Thanks, It’s working for me :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.