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

how to read specific lines from a text file  RSS feed

 
Igbe Jr. Chukwudi
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi every body...thanks for the support i got from u.my code can now write to text-file without overwriting.
please i will need your assistance once again.i dont need to read all the lines in my text file,i just need some specific lines which are not in order.i tried to use readLine() method but,it reads lines by line and i dont need all the line.....below is my text file and those marked are those i need to read into a text Area in my GUI based application..........what should i do..THANKS.



client.txt

IGBE CHUKWUDI JNR----------------(*)
Medicine
Earth Science
IMO
PREFAB
OWERRI
234
NIGERIA
234
01-------------------------------------(*)
08060664881
C_IGBE@YAHOO.COM
AUGUST 3RD 1967
NOT A U.S.CITIZEN----------------------(*)
MALE
***********************
IGBE OBINNA .C.---------------------------(*)
Engineering
Aeronautics-Astonautics
IMO
PREFAB
OWERRI
234
NIGERIA
234
01---------------------------------------(*)
08035790943
CHUDIIGBE@YAHOO.COM
FEB. IITH 1999
U.S.CITIZEN------------------------------(*)
MALE
***********************
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, because the lines have different sizes, it's impossible to tell where a line starts and ends. That means that the only way to get line X is to skip past lines 1, 2, ..., X - 1.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!