Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Read only specified number of rows from a .csv file

 
anusha banu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one tell the code how to implement the below requirement.

Need to parse the csv file. If the file contains 1000 rows i need to read the only specified number of rows.

For Ex: 1-100

If i want to read data from 501- 600 again i need to use the same logic.

Thanks in advance.

Regards,
Anusha.
 
Swastik Dey
Rancher
Posts: 1687
7
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RandomAccessFile should solve your problem.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

To use RandomAccessFile one would need to know how long each line of the file is, which is unlikely.

You can't avoid reading lines prior to the ones you're interested in, but there should be no problem discarding those, and also to stop reading afterwards.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!