Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to read only the First Line of the File  RSS feed

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I need to parse a Text File as per our requirement .
The File will be in the Fixed Format as shown below
Means it starts with 11 and ends with 19 (The First Line is 11 the Header and 19 the Footer )



Now my requirement is that i need to read the First Line of the File and do some validations as per our requirements .

Please let me know how can i read only the First line of the File ??

Please share your suggestions .
Thanks in advance.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Problem is that i am able to read the File , but the whole content of the File is getting .

I want only a single line .

(One of the clue is that the First Line will be of 38 characters constant )

Any help would be useful .
Thanks in advance .
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will answer my question ,

BufferedReader.readLine will do it .

Thanks i got it .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!