Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 142931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:00:54+00:00 2026-05-11T08:00:54+00:00

How do you specify where to start reading in a file when using StreamReader?

  • 0

How do you specify where to start reading in a file when using StreamReader?

I have created a streamreader object, along with a file stream object. After both objects are created, how would I go upon controlling where I want the StreamReader to start reading from a file?

Let’s say the file’s contents are as follows,

// song list. // junk info. 1. Song Name 2. Song Name 3. Song Name 4. Song Name 5. Song Name 6. Song Name 

How would I control the streamreader to read from let’s say #2? Also, how could I also control where to make it stop reading by a similar delimiter like at #5?

Edit: By delimiter I mean, a way to make StreamReader start reading from (‘2.’)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:00:55+00:00Added an answer on May 11, 2026 at 8:00 am

    Are you trying to deserialize a file into some in-memory object? If so, you may want to simply parse the entire file in using ReadLine or something similar, store each line, and then access it via a data structure such as a KeyValuePair<int, string>.

    Update: Ok… With the new info, I think you have two options. If you’re looking at reading until you find a match, you can Peek(), check to see if the character is the one you’re looking for, and then Read(). Alternatively, if you’re looking for a set position, you can simply Read() that many characters and throw away the return value.

    If you’re looking for complex delimiter, you can read the entire line or even the entire file into memory and use Regular Expressions.

    Hope that helps…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to start a new Spring MVC project and I've been reading about
XAML allows you to specify an attribute value using a string that contains curly
How can I specify the filename when dumping data into the response stream? Right
Is it possible to specify a Java classpath that includes a JAR file contained
If I do not specify the following in my web.xml file: <session-config> <session-timeout>10</session-timeout> </session-config>
I would like to specify a constraint which is another type with a generic
I am reading binary data from one file that specifies intensity values across x
I got the Hello, Android program to work after reading the tutorials from Google's
Here's my idea: Start with a simple object: class dynamicObject(object): pass And to be
I have a text file with a rather large amount of data of about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.