file reading


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: file reading

  1. #1
    Join Date
    May 2004
    Location
    Belgium (Bruges)
    Posts
    2

    file reading

    Hello,

    I'm trying to read a text file who's about 160 Mb big.

    I want to read a block of 148 caracters but he only reads in the first 20 caracters of the line, even when trying to do the readline function.

    When I try 2 do this with another file I made myself it works just fine.

    The big file seems to have some problems maybe because the files comes from an american standard or somthing.
    Anyone any ideas ?

    Kind regards

    Matthias

  2. #2
    Join Date
    Apr 2004
    Posts
    50
    Try something like this

    Private Sub readIt (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim myFile As File
    Dim reader As New FileStream("PATH FOR MY FILE", FileMode.Open)
    Dim result As New ArrayList(reader.Length)
    Dim i As Integer
    Try
    i = reader.ReadByte
    result.Add(i)
    Catch ex As Exception

    End Try
    End Sub

    You will end up with your file in arraylist then you can convert it to another format. You can also try to read directly to byte array

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center