N
Nuno Gomes
Hello,
I'm doing an application to treat txt files.
At the moment i have a problem...
My txt file have special caracters like 'á' or 'ã', but doing a debug (or
simply show a message box after read the txt) the ligne the VB transform the
special caracters in '?'.
I'm using the next code:
#################################################
Do While fx(ifx) <> ""
Dim MyReader As New _
Microsoft.VisualBasic.FileIO.TextFieldParser(fx(ifx))
MyReader.TextFieldType = FileIO.FieldType.Delimited
MyReader.SetDelimiters(";")
Dim ln As String()
While Not MyReader.EndOfData
Try
ln = MyReader.ReadFields()
Dim currentField As String
For Each currentField In ln
MsgBox(currentField)
Next
Catch ex As _
Microsoft.VisualBasic.FileIO.MalformedLineException
MsgBox("Line: " & ex.Message & _
"not valid.")
End Try
End While
ifx = ifx + 1
Loop
#################################################
There's something wrong with this???...
Thank you for any help.
Nuno Gomes
I'm doing an application to treat txt files.
At the moment i have a problem...
My txt file have special caracters like 'á' or 'ã', but doing a debug (or
simply show a message box after read the txt) the ligne the VB transform the
special caracters in '?'.
I'm using the next code:
#################################################
Do While fx(ifx) <> ""
Dim MyReader As New _
Microsoft.VisualBasic.FileIO.TextFieldParser(fx(ifx))
MyReader.TextFieldType = FileIO.FieldType.Delimited
MyReader.SetDelimiters(";")
Dim ln As String()
While Not MyReader.EndOfData
Try
ln = MyReader.ReadFields()
Dim currentField As String
For Each currentField In ln
MsgBox(currentField)
Next
Catch ex As _
Microsoft.VisualBasic.FileIO.MalformedLineException
MsgBox("Line: " & ex.Message & _
"not valid.")
End Try
End While
ifx = ifx + 1
Loop
#################################################
There's something wrong with this???...
Thank you for any help.
Nuno Gomes