Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / VB Syntax / June 2008



Tip: Looking for answers? Try searching our database.

txt files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nuno Gomes - 13 Jun 2008 17:57 GMT
Hello,

I'm doing an app to treat txt files.

At the moment i have a problem, so i need some help...

My txt file have special caracters like 'á' or 'ã', but doing a debug (or
simply show a message box with the line) 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
Karl E. Peterson - 13 Jun 2008 20:03 GMT
Nuno Gomes multiposted:
> Hello,

DON'T MULTIPOST!
Signature

.NET: It's About Trust!
http://vfred.mvps.org

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.