Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compare csv data with table rows

 
divya kundapur
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to compare csv data with the table rows. I want to know how can i make it efficient.
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The detail matters but you don't give any detail.

What do you require of the comparison? Just that they are equivalent or not? The difference between the two?
Does your table have the same number of rows as your CSV file?
Does your table have the same number of columns as your CSV file?
Are the columns in the table in the same order as the columns in the CSV file?
Are the rows in the table in the same order as the rows in the CSV file?
Are the values in the table all strings and if so how do you want them compared?
How do you want the result of the comparison presented?

There are bound to be more questions but these should be enough to be going on with.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For reading CSV files I'd use one of the libraries mentioned in http://www.coderanch.com/how-to/java/AccessingFileFormats; most likely faster than writing your own CSV reader.

What are "the table rows"? Part of a web page? Part of a desktop app? Something else?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic