regex - Read text file, match & paste text in excel -


i have text file test.txt has 3 columns. 1st & 2nd columns separated 2 spaces , 2nd & 3rd columns 6 spaces. sample:

402115000518432  97517518878      idle 402115001509990  97517490827      idle 402115001555677  97517339229      idle 

all entries of 1st column begin 40211

i want 1st column of text pasted in 1st column of excel file.

i trying following code:

dim pattern = "(?<=\s*40211.*).*" dim = 1  each line in file.readlines(richtextbox3.text)             dim match = regex.match(line, pattern)              if match.success                 sheet.cells(i, 1).value = match.value                 += 1             end if         next 

but pasting 3 columns , 1st column not have 40211 part. appreciated.

use expression instead:

40211[^\s]* 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -