title: How do I read a specified line in a text file?
body: <p>Given a text file, how would I go about reading an arbitrary line and nothing else in the file?</p>
  
  <p>Say, I have a file test.txt.  How would I go about reading line number 15 in the file?</p>
  
  <p>All I've seen is stuff involving storing the entire text file as a String array and then using the value of the line number as the number of the String to use from the array... but there are some complications: The text file is enormously huge and the machine that the application I'm coding isn't exactly a top-notch system. Speed isn't the top priority, but it is definitely a major issue.</p>
  
  <p>Are there any ways to <strong>ONLY</strong> read a specific line of a text file and store the result as a string?</p>
  
  <p>Thanks for your responses:
  The file is KINDA structured. It's got 25 lines of info and then <em>X</em> lines of numbers but line 17 of the first 25 has the value of <em>X</em>.</p>
  
  <p>But then, there's 1 blank line and it repeats itself all over as a second record in the file and <em>X</em> can have a different value for each record.</p>
  
  <p>What I want to do is read and store the first 25 lines as independent values and then store the next <em>X</em> (usually around 250) lines as an array. Then I'm going to store it in an SQL database and repeat with the NEXT record until I reach the <em>Y</em>th record (the number of records in the file is in line 3)</p>
  
  <p><strong>EDIT 2</strong>:
  Alright, I think I've gotten to a solution based on a combination of your alls' responses.</p>
  
  <p>I'm going to read the first 25 lines and store it as an array. I'll copy the pertinent contents of the array to local variables then I'll delete the first 25 lines. Then, I can use the info to store the next <em>X</em> lines (the value of item 13 in the array) as an array, serialize it, store it in a database then delete the lines that I just read.</p>
  
  <p>I could then repeat the process for each subsequent record.</p>
  
  <p>Of course, this relies on one assumption I'm making, which to be honest, I'm not sure is true. Is it possible to delete the first <em>n</em> lines from a text file from within C# without having to read the entire thing and re-write it without the first <em>n</em> lines?</p>