Hello,
I want to read an 1GB text file in parts of 100 lines. When I use just a
simple stram/filereader, I think it reads the whole file, wich results in a
hanging machine. Is there a way to do it in blocks? For debugging this is a
lot easyer.
Patrick 5 3916
Patrick Sannes wrote: Hello,
I want to read an 1GB text file in parts of 100 lines. When I use just a simple stram/filereader, I think it reads the whole file, wich results in a hanging machine. Is there a way to do it in blocks? For debugging this is a lot easyer.
Patrick
I've used StreamReader.ReadLine() on 100+ MB files just fine, and it didn't
read the whole file, just that line.
>> Hello,
I want to read an 1GB text file in parts of 100 lines. When I use just a simple stram/filereader, I think it reads the whole file, wich results in a hanging machine. Is there a way to do it in blocks? For debugging this is a lot easyer.
Patrick
I've used StreamReader.ReadLine() on 100+ MB files just fine, and it didn't read the whole file, just that line.
You tried something like:
StreamReader sr = File.OpenText(filename);
String input = sr.ReadLine();
??
Patrick Sannes <pa*****@nospam.penan.nospam.nl> wrote: I want to read an 1GB text file in parts of 100 lines. When I use just a simple stram/filereader, I think it reads the whole file, wich results in a hanging machine. Is there a way to do it in blocks? For debugging this is a lot easyer.
How are you reading it? If you use TextReader.ReadToEnd it will indeed
read the whole file. If you just use ReadLine it will only read a line
at a time.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Patrick Sannes wrote: Hello,
I want to read an 1GB text file in parts of 100 lines. When I use just a simple stram/filereader, I think it reads the whole file, wich results in a hanging machine. Is there a way to do it in blocks? For debugging this is a lot easyer.
Patrick
I've used StreamReader.ReadLine() on 100+ MB files just fine, and it didn't read the whole file, just that line.
You tried something like: StreamReader sr = File.OpenText(filename); String input = sr.ReadLine();
??
Yep, just like that.
I tried it and it works... Thanks
"Bret Pehrson" <br**@classicade.com> schreef in bericht
news:41***************@classicade.com... Patrick Sannes wrote: >> >> Hello, >> >> I want to read an 1GB text file in parts of 100 lines. When I use just >> a >> simple stram/filereader, I think it reads the whole file, wich results >> in >> a >> hanging machine. Is there a way to do it in blocks? For debugging this >> is >> a >> lot easyer. >> >> Patrick > > I've used StreamReader.ReadLine() on 100+ MB files just fine, and it > didn't > read the whole file, just that line.
You tried something like: StreamReader sr = File.OpenText(filename); String input = sr.ReadLine();
??
Yep, just like that. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rigga |
last post by:
Hi,
I am new to Python and need to parse a text file and cut parts out i.e. say
the text file contained 5 rows of text:
line 1 of the text file
line 2 of the text file
line 3 of the text...
|
by: Krish |
last post by:
I have requirement, that i get one big chunk of text file. This text file
will have has information, that on finding "****End of Information****", i
have to split them individual text file with our...
|
by: Chris |
last post by:
Hi
I can use a text file as a datasource but am unable to get the datatable to
see the text file as having multiple columns. Everything gets
put into the first column in the datatable. Sample of...
|
by: Yunus's Group |
last post by:
Yunus's Group May 23, 3:36 pm show options
Newsgroups: microsoft.public.dotnet.languages.vb
From: "Yunus's Group" <yunusasm...@gmail.com> - Find messages by this
author
Date: 23 May 2005...
|
by: AHP |
last post by:
Hi,
I'm using Visual Studio 2005. I am developing a web application that uses
the FileUpload control to upload text files to a directory on a webserver.
This works fine.
However, for me to be...
|
by: Andyza |
last post by:
I'm using FileSystemObject to open and write to a tab delimited text
file.
First, I connect to a database and select some data. Then I create the
text file and insert each record in the text...
|
by: R. P. |
last post by:
Subject: XSLT to transform a flat XML file into a structured text file
I have an XML file that lists the PDF file segment names and titles of a
larger document and looks something like this:
...
|
by: Osoccer |
last post by:
...to a different folder and in the relocated file concatenates all of the lines in one long string with a space between each line element. Here is a fuller statement of the problem:
I need a...
|
by: Atran |
last post by:
Hello:
In this article: You will learn to Write or Read A Text File.
Let's Begin:
First Create a new project (ConsoleApp or WinApp).
And Make sure your program uses these namespaces:
using...
|
by: bluemountain |
last post by:
Hi there,
Iam new to python forms and programming too
I had a text file where i need to extract few words of data from the header(which is of 3 lines) and search for the keyword TEXT1, TEXT2,...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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...
| |