473,396 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

File.ReadAllLines() doesn't read all lines

Hi!
I've a weird problem using ReadAllLines Function.
I have a plain text file which has about 6500 lines, each one representing a 3D point. I read the text file and store it in a string array using ReadAllLines(). The thing is that the first time I call the function it only reads about 512 lines and stores them in the array. Second time it reads only 250, next time about 120 and so on. I do nothing with the text file beetween each read. Even if I start debugging, stop debugging just after the ReadAllLines call, and start debugging again, the second time it reads only half the lines it reads during the first debug. What am I missing???
Many thanks.
Mar 29 '07 #1
1 3373
vijaydiwakar
579 512MB
Hi!
I've a weird problem using ReadAllLines Function.
I have a plain text file which has about 6500 lines, each one representing a 3D point. I read the text file and store it in a string array using ReadAllLines(). The thing is that the first time I call the function it only reads about 512 lines and stores them in the array. Second time it reads only 250, next time about 120 and so on. I do nothing with the text file beetween each read. Even if I start debugging, stop debugging just after the ReadAllLines call, and start debugging again, the second time it reads only half the lines it reads during the first debug. What am I missing???
Many thanks.
sho ur code
Mar 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: CCLeasing | last post by:
Hello, I have searched google but can not find a straight forward answer to my problem. Hopefuly someone will be kind enough to offer their expertise. Please forgive if this seems a bit convoluted...
3
by: CCLeasing | last post by:
Hi i'm trying to check if the last line in a file is equal to a string i'm comparing it with. I have the general idea of what I should be doing. Could someone take a look at the following and...
4
by: Stupid48 | last post by:
I'm trying to do a simple task but can't seem to find a solution. How do I read lines from a text file backwards. i.e. I want to select the last 20 lines of a text file and display them in...
9
by: Clinto | last post by:
Hi, I am trying to find the fastest way to search a txt file for a particular string and return the line that contains the string. I have so for just used the most basic method. Initialized a...
4
by: Curious | last post by:
I have a file to which I'll need to at first read until it locates the last line of string. According to content of the last line of string, I'll need to write something to this file right after...
13
by: kronecker | last post by:
I am trying to delete multiple lines in a text file using the following Private Sub Read_TextFile() Dim objReader As StreamReader Dim strfull, strContents, strContentsold, strContentsnew As...
4
by: Jerry Spence1 | last post by:
I'm doing: Dim Contents() As String = System.IO.File.ReadAllLines("C:\MyFile.txt") with upwards of 100,000 lines. This is a brilliantly simple and fast way of creating an array from a text...
2
by: nithin.papdeja | last post by:
Hi all, I have to parse a .txt file and retrieve only "Name" from second column and store it in a list My text file is of this format: Bit Name Description -1 Lucky groupa -1 Roy groupb
4
by: Keith G Hicks | last post by:
I'm trying to read a text file and alter the contents of specific lines in the file. I know how to use streamreader to read each line of a file. I'm doing that already to get the data into a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.