using the input command, but ignoring commas
i have a cfg file that i need to read, but ive come across a problem. i need to read it a line at a time, but the lines may have commas in them. i tryed to just use the input command, but it seperated what it was reading in by the commas.
for example, this might be the first line of the text file
i want to input that into a variable, but right now i can only figure out how to read the "for example" and " this might be the first line of the text file" seperatly, since they are seperated by a comma.
i didnt make the cfg file, so i have to read it as is. any help is appreciated
Re: using the input command, but ignoring commas
Well, I'm not shur about how to read a single line at a time but, you could use an alternative; read the whole fine inot an array and then opperate functions using the array :)
VB Code:
Dim intFree As Integer
Dim strReadText As String
Dim strTextLines() As String
intFree = FreeFile
Open "C:\SomeFile.cfg" For Binary Access Read As #intFree
strReadText = Space$(LOF(intFree))
Get #intFree, , strReadText
Close #intFree
' Create array of text lines from the file...
strTextLines = Split(strReadText, vbNewLine)
MsgBox strTextLines(0) ' First line...
MsgBox strTextLines(1) ' Second line...
Is an example I posted earlier today :)
Cheers,
RyanJ
Re: using the input command, but ignoring commas
instead of using Input, use Line Input.
casey.