delimiter

  • Thread starter Thread starter hughie
  • Start date Start date
H

hughie

Having output text from a dos batch file, I read it back into a text
box on a userform thus:

Open fileName For Input As #1
Do While Not EOF(1)
Input #1, x
str = str & x & vbCrLf
Loop

...and then send 'str' back as the result of a function.

When the file has commas in it, the text box reads them as line breaks.
Does anyone know how to stop this?

tia,
Hughie
 
Hughie,
Maybe getting the whole file in one go is suitable ?

Dim FileNum As Long
Dim FileStr As String

FileNum = FreeFile
Open "C:\Test.txt" For Input As FileNum
FileStr = Input$(LOF(FileNum), #FileNum)
Close #FileNum

Debug.Print FileStr

NickHK
 
Back
Top