| | |
Retrieving data from .CSV file and displaying it in ListView Help!!!
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2008
Posts: 2
Reputation:
Solved Threads: 0
Hey guys I am a VB noob and need some help, basically this is what I want to do please look at the following picture
CLICK FOR PICTURE
The app should basically pull up the data contained within this CSV file :
CLICK FOR CVS FILE
and display it in the listview with 2 columns (with the values seperated for each column in the listview).
Here is that code I have so far (keep in mind I am a noob)
Any idea how to go about this one? I'd really appreciate your input. Thanks~
CLICK FOR PICTURE
The app should basically pull up the data contained within this CSV file :
CLICK FOR CVS FILE
and display it in the listview with 2 columns (with the values seperated for each column in the listview).
Here is that code I have so far (keep in mind I am a noob)
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim objReader As IO.StreamReader Dim intcount As Integer Dim intcount2 As Integer If IO.File.Exists("f:\surveydata.csv") = True Then objReader = IO.File.OpenText("f:\surveydata.csv") Do While objReader.Peek <> -1 _strRespondend(intcount) = objReader.ReadLine() _strMilk(intcount) = objReader.ReadLine() intcount += 1 Loop For intcount = 0 To (_strRespondend.Length - 1) Me.lstSurveyDisplay.Items.Add(_strRespondend(intcount)) 'Do While objReader.Peek <> -1 '_strMilk(intcount2) = objReader.ReadLine() ' ' intcount2 += 1 'Loop Next For intcount2 = 0 To (_strMilk.Length - 1) Me.lstSurveyDisplay.Items(intcount2).SubItems.Add(_strMilk(intcount2)) Next objReader.Close() Else MessageBox.Show("The file is not available. Please restart the program when file is available.", "Error") Me.Close() End If End Sub
Any idea how to go about this one? I'd really appreciate your input. Thanks~
Last edited by mobman; Jul 5th, 2008 at 2:25 am.
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Autonumber in Access (VBA)
- Next Thread: maskedbox
Views: 1015 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





