Read lines from text file

Hi, Team!
I have a .txt file and I want to keep the first 10 characters from each line.
Can you help me please?

3,0 770331208 500 Pc 418,60 1.883,70
Union flat seat Index 32,20
331 11/2. G Multi 13,00
Discount -10,00%

4,0 770245235 100 Pc 642,20 577,98
Hexagon nipple, reducing Index 49,40
245 21/2.2. G Multi 13,00
Discount -10,00%

Thanks,

1 Like

You can use Read Text File activity and after that you will use:
MyLines = myText.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries)
In a for Each you can use:
myTenChars = item.SubString(0, 10)

3 Likes

There you go. You do have to account for cases where the number of characters in the line is less than 10.

Processusvierge.zip (838,1 Ko)

2 Likes

Thank you so much for your contribute!

Thank you so much for your contribute! It helps me gather information. Iā€™m a beginner :slight_smile:

1 Like

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