• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

compare csv data with table rows

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 781
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For reading CSV files I'd use one of the libraries mentioned in https://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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic