473,399 Members | 2,774 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,399 software developers and data experts.

Read text file bottom up

Lam
Hi

the default readline method in StreamReader read the text from the top to
bottom
how can I read a text file from the bottom to the top?
Thanks
Nov 17 '05 #1
2 6286
Hi Lam,
you can use the ReadBlock method of StreamReader to read in a block of
data from a specified starting position

ReadBlock(char[], intIndex, intCount);

the char[] is where the data will be read to, intIndex is the starting
position of where to read and intCount is the max number of characters to
read.

You can have a loop which decrements intIndex from max to min which will
read the file backwards.
Hope that helps
Mark.

"Lam" wrote:
Hi

the default readline method in StreamReader read the text from the top to
bottom
how can I read a text file from the bottom to the top?
Thanks

Nov 17 '05 #2
Lam
Thanks
one more question
How can I delete the line after I read in the line from the text file?

"Mark R. Dawson" <Ma*********@discussions.microsoft.com> wrote in message
news:C9**********************************@microsof t.com...
Hi Lam,
you can use the ReadBlock method of StreamReader to read in a block of
data from a specified starting position

ReadBlock(char[], intIndex, intCount);

the char[] is where the data will be read to, intIndex is the starting
position of where to read and intCount is the max number of characters to
read.

You can have a loop which decrements intIndex from max to min which will
read the file backwards.
Hope that helps
Mark.

"Lam" wrote:
Hi

the default readline method in StreamReader read the text from the top to bottom
how can I read a text file from the bottom to the top?
Thanks

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: James Aguilar | last post by:
Hey all, I'm working on an encoding scheme where I am running into a problem with reading a file off a stream. Looking at the binary encoding of the file (using a simple hex editor), there is...
2
by: Robbie | last post by:
Anybody out there know of a way to read a text file starting from the bottom of the file then going backwards line by line? I am reading large log files in which the data I'm looking for is...
4
by: ESPN Lover | last post by:
Below is two snippets of code from MSDN showing how to read a file. Is one way preferred over the other and why? Thanks. using System; using System.IO; class Test { public static void...
7
by: J | last post by:
I am new to web design and I am looking for some advice on putting images within paragraphs of text. I have determined that sizing the height of my images to a given number of lines of text seems...
6
by: xdeath | last post by:
Hi guys, i've currently got an assignment, whereby, im supposed to create 2 classes, a Vehicle superclass, and a Taxi subclass. Vehicle class needs to have Reg Number, model, price, and Taxi is...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
7
by: Samant.Trupti | last post by:
I need to read a huge file. The content that I want to read are somewhere at the bottom. Can anyone please let me know a way to read the file bottom up? Thanks Trupti
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.