Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Sergio.D.Suárez
in reply to: Anonymous

Your code is fine, what happens is that you need to have well defined the separators of the strings, otherwise the task becomes more difficult. regards

 

oFile = "C:\Users\Sergio\Desktop\Example.txt"

oRead = System.IO.File.OpenText(oFile)

'read the file
oRead = System.IO.File.OpenText(oFile)
EntireFile = oRead.ReadToEnd()
oRead.Close()

'create aray from text info
'splitting at that comma
oSplit = Split(EntireFile, " ")

For Each wrd In oSplit
MessageBox.Show("Word Index #" & i & " = " & oSplit(i))
i += 1
Next

 


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn