Extract data from txt

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.
%E5%9B%BE%E7%89%87

How I can get “HANDLING CHARGE EXPORT” together?

Anyone can help?

Thank you!

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

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.

%E5%9B%BE%E7%89%87

The text I want to extract is in the middle of txt file.

here is my workflow.

Could you have better advise?

thank you.

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

Hi @joyozou

Check the below post
How to split word in a line which contains comma as a separator give syntax

Thanks
Ashwin.s

Dear Manjuts,

Here is the output to second write cell.

%E5%9B%BE%E7%89%87

thank you!

A little difficult to me to understand how to split word in a line which contains comma as a separator.