Array txt to excel

Hello

I have the next text in file .txt

TERM DOCTO TDA VEND
2 7162 0002 13453297

  NAME: FABIOLA ROCHA

COL IND BROADWAY SECC 111 N
1018866800 7,999.00
DESC X PROM % 25.00 1,999.75-
CORTAIN SUEDE DISEÑ SECC 108 N
0049078757 359.00
DESC X PROM % 25.00 89.75-
COLUMPIO BARRO 90 SECC 116 N
0050662314 215.00
DESC X PROM % 25.00 53.75-

***** TOTAL $ 6,429.75

SIX THOUSAND PESOS
TWENTY PESOS 75/100 M.N.*

       TOTAL$         6,429.75

642975000000000000-6429750000000000000
00000000000000000000000000000000000000
CUSTOMER MON 6/AGO/2018 09:10

rgtor.com.mx

code invoice

store| likes
BRSUNHQQBDRLTJGYQJBX
END


So I need to extract starting with the eord “DOCTO” and finishing wuth the word “END”, I need to extract the text and pass to excel

I need an array but how i can do this,

My string starting is this strWordStart = Ok.Split({“DOCTO”}, System.StringSplitOptions.None)(cont+1).Trim.Split(System.Environment.Newline(1))(6).Trim

but my answer is this 1018866800 7,999.00,

please if you can upload the xaml

thank you

1 Like

(if you are still having this issue open :slight_smile: )

Here is what you can use to split and get the array:
input.Substring(input.IndexOf(“DOCTO”)).Split(Environment.NewLine.ToArray,StringSplitOptions.RemoveEmptyEntries)

Output will look like below:

1 Like