6 Replies - 2672 Views - Last Post: 17 December 2008 - 12:50 PM Rate Topic: -----

#1 Backtracker  Icon User is offline

  • D.I.C Head

Reputation: -23
  • View blog
  • Posts: 163
  • Joined: 30-November 08

Read The 5th Line of a Text File...

Posted 16 December 2008 - 08:34 AM

How it read only the 5th line of a text file?
Reader.ReadLine(5) ?
Is This A Good Question/Topic? 0
  • +

Replies To: Read The 5th Line of a Text File...

#2 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Read The 5th Line of a Text File...

Posted 16 December 2008 - 08:40 AM

Use a counter to keep track of how many lines you have read from the file. When the counter reaches 5, stop reading the file and process the last line of data read from the file.
Was This Post Helpful? 0
  • +
  • -

#3 Backtracker  Icon User is offline

  • D.I.C Head

Reputation: -23
  • View blog
  • Posts: 163
  • Joined: 30-November 08

Re: Read The 5th Line of a Text File...

Posted 16 December 2008 - 09:11 AM

View PostJayman, on 16 Dec, 2008 - 07:40 AM, said:

Use a counter to keep track of how many lines you have read from the file. When the counter reaches 5, stop reading the file and process the last line of data read from the file.


I know but i would like to do this using a more simplified method...
Was This Post Helpful? 0
  • +
  • -

#4 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Read The 5th Line of a Text File...

Posted 16 December 2008 - 09:47 AM

It doesn't get any simpler than that. I mean come on now, it takes a total of 4 lines of code to accomplish this task.

What else do you want?
Was This Post Helpful? 1
  • +
  • -

#5 Backtracker  Icon User is offline

  • D.I.C Head

Reputation: -23
  • View blog
  • Posts: 163
  • Joined: 30-November 08

Re: Read The 5th Line of a Text File...

Posted 16 December 2008 - 12:52 PM

its for somekind of guitar hero game that shows the notes based on there position in a text file i will post my work here when its done thanks for your help anyway...
minimum song text file will consist of 10 x 120 x 1 x 10 = 12.000 lines ;(

This post has been edited by Backtracker: 16 December 2008 - 12:54 PM

Was This Post Helpful? 0
  • +
  • -

#6 n8wxs  Icon User is offline

  • --... ...-- -.. . -. ---.. .-- -..- ...
  • member icon

Reputation: 972
  • View blog
  • Posts: 3,878
  • Joined: 07-January 08

Re: Read The 5th Line of a Text File...

Posted 17 December 2008 - 12:22 PM

Are the lines in your file fixed length by any chance?

This post has been edited by n8wxs: 17 December 2008 - 12:29 PM

Was This Post Helpful? 0
  • +
  • -

#7 Backtracker  Icon User is offline

  • D.I.C Head

Reputation: -23
  • View blog
  • Posts: 163
  • Joined: 30-November 08

Re: Read The 5th Line of a Text File...

Posted 17 December 2008 - 12:50 PM

??? sorry can not understand the question...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1