Click here to Skip to main content
15,920,503 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralQuestion on Directory Pin
Anonymous2-Aug-05 22:11
Anonymous2-Aug-05 22:11 
GeneralRe: Question on Directory Pin
Anonymous2-Aug-05 22:12
Anonymous2-Aug-05 22:12 
GeneralRe: Question on Directory Pin
Dave Kreskowiak3-Aug-05 6:33
mveDave Kreskowiak3-Aug-05 6:33 
GeneralAccess... Pin
vtalau2-Aug-05 17:29
vtalau2-Aug-05 17:29 
GeneralRe: Access... Pin
Christian Graus2-Aug-05 18:20
protectorChristian Graus2-Aug-05 18:20 
GeneralOperation New() :: Plase help me Pin
TooLeeDiN2-Aug-05 17:20
TooLeeDiN2-Aug-05 17:20 
GeneralRe: Operation New() :: Plase help me Pin
Christian Graus2-Aug-05 18:01
protectorChristian Graus2-Aug-05 18:01 
GeneralParsing Comma Delimited data in txt file Pin
MeterMan2-Aug-05 16:47
MeterMan2-Aug-05 16:47 
Hi,
Can someone please help me in understanding why this code will not work in visual basic .net 2003 ?
I have generated a text file from an access database and I'm trying to read it with my program so hopefully I can manipulate it and write it back to a file. I am having issues with textfieldparser it doesn't appear to exist. Is there an easy way to do this? A working example with a simply txt file would be wonderful or a very step by step tutorial on a website. Thanks for your time.

[code]
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
Dim oFileDlg As New OpenFileDialog

If oFileDlg.ShowDialog() = DialogResult.OK Then
Dim sr As New System.IO.StreamReader(oFileDlg.FileName)
MessageBox.Show(oFileDlg.FileName)
sr.Close()
End If
Dim reader As Microsoft.VisualBasic.FileIO.TextFieldParser
reader = My.Computer.FileSystem.OpenTextFieldParser _
("C:\TestFolder1\test1.txt")
reader.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited
reader.delimiters = New String() {","}
Dim currentRow As String()
While Not reader.EndOfData
Try
currentRow = reader.ReadFields()
Dim currentField As String
For Each currentField In currentRow
MsgBox(currentField)
Next
Catch ex As System.Text.Parsing.MalformedLineException
MsgBox("Line " & ex.Message & _
"is not valid and will be skipped.")
End Try
End While


End Sub
[/code]

Win32newb
"Programming is like sex, make one mistake and you have to support it for a long time"
GeneralRe: Parsing Comma Delimited data in txt file Pin
Christian Graus2-Aug-05 16:59
protectorChristian Graus2-Aug-05 16:59 
GeneralRe: Parsing Comma Delimited data in txt file Pin
MeterMan7-Aug-05 19:07
MeterMan7-Aug-05 19:07 
GeneralRe: Parsing Comma Delimited data in txt file Pin
Christian Graus7-Aug-05 19:13
protectorChristian Graus7-Aug-05 19:13 
GeneralRe: Parsing Comma Delimited data in txt file Pin
MeterMan7-Aug-05 19:25
MeterMan7-Aug-05 19:25 
GeneralRe: Parsing Comma Delimited data in txt file Pin
Christian Graus8-Aug-05 13:07
protectorChristian Graus8-Aug-05 13:07 
GeneralRe: Parsing Comma Delimited data in txt file Pin
MeterMan8-Aug-05 13:13
MeterMan8-Aug-05 13:13 
GeneralRe: Parsing Comma Delimited data in txt file Pin
Christian Graus8-Aug-05 13:18
protectorChristian Graus8-Aug-05 13:18 
GeneralRe: Parsing Comma Delimited data in txt file Pin
MeterMan8-Aug-05 15:26
MeterMan8-Aug-05 15:26 
GeneralRe: Parsing Comma Delimited data in txt file Pin
Christian Graus8-Aug-05 17:15
protectorChristian Graus8-Aug-05 17:15 
GeneralRe: Parsing Comma Delimited data in txt file Pin
Scott Serl2-Aug-05 21:29
Scott Serl2-Aug-05 21:29 
GeneralRe: Parsing Comma Delimited data in txt file Pin
MeterMan3-Aug-05 6:02
MeterMan3-Aug-05 6:02 
GeneralAccess...pass a value from one form to another form Pin
vtalau2-Aug-05 16:27
vtalau2-Aug-05 16:27 
GeneralRe: Access...pass a value from one form to another form Pin
RichardBerry3-Aug-05 0:36
RichardBerry3-Aug-05 0:36 
GeneralSet Date and Time on Terminal Pin
gilbertors2-Aug-05 15:17
gilbertors2-Aug-05 15:17 
GeneralWindows Registry Check Pin
andyr20052-Aug-05 11:04
andyr20052-Aug-05 11:04 
GeneralRe: Windows Registry Check Pin
Christian Graus2-Aug-05 14:43
protectorChristian Graus2-Aug-05 14:43 
GeneralRe: Windows Registry Check Pin
andyr20053-Aug-05 1:58
andyr20053-Aug-05 1:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.