Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to access of record randomly

 
rudra tripathy
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have got a files with predefined format.
i want to access each record randomly.
each record is a line.
pls help me
 
karl koch
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

how many records are in your file ?
if there is only a small number of records, then you can read it into an array (String[] or MyRecord[])or List manipulate it and then write it back to disk. or you can just acccess the file, skip all the lines you dont need...

also check the RandomAccessFile API and
google random access file or consider a real database.

cheers
k
[ July 05, 2004: Message edited by: karl koch ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic