Text to column txt to excel

I have data txt
123456789
But i wont text to column data to excel and the result in excel file
123 4567 89 .
How i can do with uipath…? Anyone help me
Thx

Hi @den_bagus

You can do that by following:
1.Read Text file by [Read text file] activity
2.Substring your text and agsing value to variable

variable1 = str.Substring(0, 3)
variable2 = str.Substring(3, 4)
variable3 = str.Substring(7, 2)

3.Using [Write Cell] to input your string to Excel column

Please refer as below for guideline.
Text to Excel.zip (23.4 KB)

I hope it will be useful to you :blush:

Hi @den_bagus

As @Natapong said you can perform the steps if the string is constant,

If the string is not constant then you need perform more string / regex operations

Hope this helps

Thanks

Thx for your help but my case is if in the txt file
Pga
1234567890app
Pga
1234567890d/1
In my excel
123 4567 890 app
123 4567 890 d/1
Not follow use PGA in my excel
Please more help

Hi @den_bagus

Use Regex

(?<=(Pga))((\n).*)

It will give you the what ever after Pga, once matched then you can do the substring to divide the string

Check below post for your reference

Hope this helps

Thanks

1 Like