title: .NET C# - Random access in text files - no easy way?
body: <p>I've got a text file that contains several 'records' inside of it. Each record contains a name and a collection of numbers as data. </p>
  
  <p>I'm trying to build a class that will read through the file, present only the names of all the records, and then allow the user to select which record data he/she wants. </p>
  
  <p>The first time I go through the file, I only read header names, but I can keep track of the 'position' in the file where the header is. I need random access to the text file to seek to the beginning of each record after a user asks for it.</p>
  
  <p>I have to do it this way because the file is too large to be read in completely in memory (1GB+) with the other memory demands of the application.</p>
  
  <p>I've tried using the .NET StreamReader class to accomplish this (which provides very easy to use 'ReadLine' functionality, but there is no way to capture the true position of the file (the position in the BaseStream property is skewed due to the buffer the class uses).</p>
  
  <p>Is there no easy way to do this in .NET? </p>