I opened a text file, loaded it into a string and now i want to read it line by line. How do i make this?
thnx
Printable View
I opened a text file, loaded it into a string and now i want to read it line by line. How do i make this?
thnx
Open STRFILENAME For Input As #1
Do While Not EOF(1)
Input #1, line
debug.print line
Loop
Close #1
can't i make this a loop? i'm using .net so i don't use the input thing.
Don't know why you would want to do it this way but you could use the split function to get each line and then loop through the array that is created.
<code>can't i make this a loop? i'm using .net so i don't use the input thing
</code>
can't i make this a loop ?
din realli get the questions .
i'm using .net so i don't use the input thing
sorry , i do not know any anithing about .net, i m using vb 6. sorri for tat . :rolleyes:
sorry,
i was thinking about a loop that reads through a string untill it sees an enter. I don't know how to see the enter. the rest is quite easy. Do u know of another way to do this without the line statement?
'''''''''''''''''''''''''''''''''''''''
' Dim arr() As String
' Dim i As Integer
'
'
'
'
' Open App.Path & "this.txt" For Input As #1
' arr = Split(Input(LOF(1), 1), vbCr)
'
' Close #1
'
' For i = 0 To UBound(arr)
'' Debug.Print arr(i)
' MsgBox arr(i)
' Next i
'' ''''''''''''''''''''''''''''''''''''''
Anyway i use the do while not EOF , cos i think it is much simpler n din tok of the split() cos i hardly use it .., thaxs for pointing out :D
thnx, i changed it a bit and now it works, do u also know a way to split up a string like this
Hello=hallo
into
knownword = hallo
unknownword = hello
Thnx
Hello=hallo
into
knownword = hallo
unknownword = hello
Thnx
u wan to change onli 1 letter in the sentence rite ?
if u are trying to change a letter u can use the Mid$() ?
unknownword=mid$(knownword,2,1)
ahhhh no not at all :-)
the 2nd line looks like this:
hallo=hello
how do i split this line up in hello and hallo?
http://www.vbforums.com/showthread.p...ighlight=split
i think this thread might have wat u need...