Learn how to a build a cloud-first strategyRegister Now


Best Method to Read Files in VB.Net

Posted on 2009-02-20
Medium Priority
Last Modified: 2012-05-06
Dear Experts,

We are going to write a VB.Net program which will read huge files and parse them. The file size will be between 1-4 GB. Which is the best efficient method to read such huge files in VB.Net? Any recommendation with some documentation welcomes.

Best regards.

Question by:GurcanK
  • 3
  • 2
LVL 53

Expert Comment

ID: 23690588
What exactly do you want to do with the files ?

An enumerable class to read large text files in a For Each loop

Author Comment

ID: 23690822
We're going to parse some fields from a formatted text file and write to a database.
LVL 53

Expert Comment

ID: 23690860
Do you know where in the file the fields are that you need or do you need a field from each textline in the file ?

Author Comment

ID: 23690935
Yes, we know where the needed fields are in each line.
LVL 53

Accepted Solution

Dhaest earned 750 total points
ID: 23690945
If it's in each line and the files are so big, I would read them line by line, do whatever you want to do with the data and close the file.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question