This week's book giveaway is in the Java in General forum.
We're giving away four copies of Java by Comparison (eBook) and have Simon Harrer, Jörg Lenhard, Linus Dietz on-line!
See this thread for details.
Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need to develop a Quality checking software Urgent!!!  RSS feed

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody
I need some help in devloping a qualiyt control software.
My company records are kept in a lot on excel spreads sheets.
I need to create a software which picks some records at random for checking from these files.
But how do I load these separate (lot of) files & then pick out random records from them on the whole.
Like for example there are 10000 records in say 5 files 200 each
I need a random sample of 70 from the 10000 files ( not from indivual files)
Any suggestions as to how I do it??
Your help will be greatly appriciated
Farooq
 
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you give each file input an identifier (say number them from 1 to 5, or it variable name, whatever) and each record a number, then the combination of the file number and record number uniquely identifies each record.
Load each identifier up into a SortedMap, giving them each a key which is a random number. When the random number key scrambles them up, just pull the top 70 records from the stack and deal with them.
 
Farooq Ali
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry cindy I didn't get it
First of all how should I read from the excel files??
should it be like connecting thru jdbc & extracting the recods from all of the files??
I wan to simultaneously access somewhere like 10-15 separate excel files & treat them as one??
if I first read them thru jdbc & save the data its going to be quite cumbersome don't you think
please let me know
Farooq
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can use JDBC to get at the excel files, there are quite a few discussions of this in the JDBC forum. Here is a sample one: http://www.javaranch.com/ubb/Forum3/HTML/000342.html
However I wouldn't think that you need to read in ALL of the records from the excel files, just create your random selection mechanism, and only read the selected records.
 
Farooq Ali
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Cindy...
but still without JDBC how do I read MS EXcel files in my java program??
Farooq
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't.

Unless you want to study the *.xls file format, and use a whole bunch of byte offset manipulation to find rows and columns.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!