silki
asked on
Read from a TEXT file ??
HI
Can some please tell me the best way in vb to read froma text file
I have one.csv
silki,19,silki@mydomain.co m
james,34,james@mydomain.co m
SPJ,56,SPJ@mydomain.com
So i wish to read in each line do sumthing with the data then move next ?????
One question will this be reliable as my past ASP FSO experinec had been bad ????
SILKI
Can some please tell me the best way in vb to read froma text file
I have one.csv
silki,19,silki@mydomain.co
james,34,james@mydomain.co
SPJ,56,SPJ@mydomain.com
So i wish to read in each line do sumthing with the data then move next ?????
One question will this be reliable as my past ASP FSO experinec had been bad ????
SILKI
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
This is better as i need to deal with each one on its own
SILKI
This is better as i need to deal with each one on its own
SILKI
Make sure you dimension the variables appropriately, so instead of all variants:
Dim Fld1, Fld2, Fld3
They could be:
Dim Fld1 As String, Fld2 As Integer, Fld3 As String
Thanks for the points,
Anthony
Dim Fld1, Fld2, Fld3
They could be:
Dim Fld1 As String, Fld2 As Integer, Fld3 As String
Thanks for the points,
Anthony
Open "TESTFILE" For Input As #1 ' Open file.
Do While Not EOF(1) ' Loop until end of file.
Line Input #1, TextLine ' Read line into variable.
Debug.Print TextLine ' Print to the Immediate window.
Loop
Close #1 ' Close file.