N
newsaboutgod
I think VB.NET drives some people crazy because some simple VB6 things
seem so hard.
Here is some VB6 code:
'Write CSV File
open "c:\test.csv" for output as #1
write#1, "1","2","3","4","5"
write#1, "1","2","3","4","5"
write#1, "1","2","3","4","5"
Close#1
'Read CSV File
open "c:\test.csv" for input as #1
input#1, A$,B$,C$,D$,E$
input#1, A$,B$,C$,D$,E$
input#1, A$,B$,C$,D$,E$
Close#1
Works perfect and real easy. I can also open up the file in excel.
In VB.NET I can write the file the same way with:
FileOpen(1, "c:\testfile2.csv", OpenMode.Output)
WriteLine(1, "1", "2", "3", "4")
WriteLine(1, "2", "2", "3", "4")
WriteLine(1, "3", "2", "3", "4")
FileClose(1)
Now, how can I easily read the file from VB.NET into variables???? It
is driving me crazy and there seems to be about 10 different ways but
I want a simple CSV read routine. THANKS for any help.
Sheila
seem so hard.
Here is some VB6 code:
'Write CSV File
open "c:\test.csv" for output as #1
write#1, "1","2","3","4","5"
write#1, "1","2","3","4","5"
write#1, "1","2","3","4","5"
Close#1
'Read CSV File
open "c:\test.csv" for input as #1
input#1, A$,B$,C$,D$,E$
input#1, A$,B$,C$,D$,E$
input#1, A$,B$,C$,D$,E$
Close#1
Works perfect and real easy. I can also open up the file in excel.
In VB.NET I can write the file the same way with:
FileOpen(1, "c:\testfile2.csv", OpenMode.Output)
WriteLine(1, "1", "2", "3", "4")
WriteLine(1, "2", "2", "3", "4")
WriteLine(1, "3", "2", "3", "4")
FileClose(1)
Now, how can I easily read the file from VB.NET into variables???? It
is driving me crazy and there seems to be about 10 different ways but
I want a simple CSV read routine. THANKS for any help.
Sheila