joyozou
(joyo)
#1
Hello All,
I am trying to extract the data from txt to excel.
Here is the text I am extract now
CHARGE SGD
HANDLING CHARGE EXPORT 75.00 EUR 124.83 0
I use below to write to cell.
((textData.Split(vbnewline.ToCharArray)(counter+2).ToString).Split(" "c)).first
However, I can only get the first data.

How I can get “HANDLING CHARGE EXPORT” together?
Anyone can help?
Thank you!
AshwinS2
(Ashwin S)
#2
Hi @joyozou
Use string array variable and say text.split(system.environment.newline(0))
Thanks
Ashwin.S
@joyozou
String value = System.Text.RegularExpressions.Regex.Split(urVariableName,"\d").ToArray(0)
if ur variable contains “HANDLING CHARGE EXPORT 75.00 EUR 124.83 0”
u wil get output as “HANDLING CHARGE EXPORT” from above code
joyozou
(joyo)
#4
Dear Manjuts,
It’s working. But it didn’t get the text I want it to be. It can only grab the second line of text.

The text I want to extract is in the middle of txt file.
here is my workflow.
Could you have better advise?
thank you.
joyozou
(joyo)
#5
Dear Ashwin,
I try your way, but it’s not working.
Do you have any other idea?
Thank you!
@joyozou what output u getting in second write cell
AshwinS2
(Ashwin S)
#7
Hi @joyozou
Check the below post
How to split word in a line which contains comma as a separator give syntax
Thanks
Ashwin.s
joyozou
(joyo)
#8
Dear Manjuts,
Here is the output to second write cell.

thank you!
joyozou
(joyo)
#9
A little difficult to me to understand how to split word in a line which contains comma as a separator.