473,395 Members | 1,539 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,395 software developers and data experts.

Read file using StreamReader

Hi,

How can i read line by line from text file using stream reader or filestream in c#.

Loius Phillip
Mar 11 '08 #1
2 1131
epots9
1,351 Expert 1GB
Moved to the .NET Forums where the resident experts can better assist you.

**Moved from Programming challenges.
Mar 11 '08 #2
Plater
7,872 Expert 4TB
I am going to answer this question, then probably lock this thread with plenty of "shame shame on you"
StreamReader has a function called "ReadLine" which, if you had bothered to even LOOK at the documentation on, you would have seen.

So StreamReaders can use ReadLine() to return line by line from a file. MSDN will have examples on it.

For Shame.
Mar 11 '08 #3

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

Similar topics

2
by: Gustaf Liljegren | last post by:
I'm writing a console program that is supposed to read a bunch of old text files written in CP437 encoding, extract parts of them and output well-formed XML in UTF-8. First problem I run into is to...
2
by: GB | last post by:
Hi Everybody! I have 2 different processes/application. One is writing to a file and another is reading from it. For some reason the code doesnt seems to work and gives mscorlib.dll IOException...
7
by: CJ | last post by:
Hello! I want to read a large text file (100 mb) and from with in the file i want to take out some lines on a spesific kriteria and make new files. eks. inputfile: 123 hello.. 123 more......
3
by: Sharon | last post by:
I'm using StreamWriter to write to file and at the same time I'm using the StreamReader to read from the same file. Doing that cause an exception when I'm trying to create the StreamReader when...
14
by: Mark Broadbent | last post by:
Does anybody know what is (factual please -not just guess) the quickest method to read data from a file? I am not interested in the format of the data (i.e. blocks, bytes, string etc) just that the...
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...
6
by: BenSimmons | last post by:
Hi i'm creating a program that reads various log files from another program (Find-a-Drug DC project). The problem is, when I read some of the logs I get the error This process cannot access the...
2
by: CsharpGuy | last post by:
I have to read a text file and parse it out to load to a db and I'm having some issues in doing it. here is what the text file looks like Dealership number: 98665362236 Location: Maryland...
5
by: dm3281 | last post by:
Hello, I have a text report from a mainframe that I need to parse. The report has about a 2580 byte header that contains binary information (garbage for the most part); although there are a...
1
by: cathy25 | last post by:
Hi, I am using the following code to read a file. DirectoryInfo dir = new DirectoryInfo(@"C:\"); try { if (dir.Exists) { ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.