Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 5th, 2009, 01:56 AM
Registered User
 
Join Date: Jul 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Compare two excel sheets row wise

Hi i am new to this forum...i want to compare two excel sheets row wise..here i want to take one row from first excel sheet and compare with all rows in another excel sheet.if any of the row from first sheet completely matches with any of the rows in second excel sheet then it shoud give report like yes or matching with this row like that in any one of the excel sheet...can anyone help me in this

thanks in advance.....
 
Old July 7th, 2009, 09:40 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

I am not aware of existing tools/code to do that. But if you are using apache POI and want to do it on your own, you can do like as follows
1. Extends HSSFRow class and override equals() method and implement your code to compare two rows. OR write a utility method in your existing class which take two HSSFRow object and compares two rows, returns true if they are equal else false.
2. Use HSSFSheet.rowIterator() to get the rows and loop through the rows of your document and call the equals() OR the utility method to compare

Hope it gives some start to solve your problem.
__________________
- Rakesh
http://iam-rakesh.blogspot.com
 
Old July 7th, 2009, 10:06 AM
Registered User
 
Join Date: Jul 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you for the response...will try in that way
 
Old July 7th, 2009, 10:09 AM
Registered User
 
Join Date: Jul 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

do i need any jar file for using poi
if in case i have to use where can i get that jar files?????


thanks in advance
 
Old July 7th, 2009, 10:11 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

check this link

http://poi.apache.org/
__________________
- Rakesh
http://iam-rakesh.blogspot.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing two excel sheets nbkn8ct Excel VBA 5 August 28th, 2009 05:20 PM
Working with excel sheets ramsri VB How-To 1 October 25th, 2007 03:15 PM
Import From excel with n sheets dbellavi SQL Server DTS 1 September 11th, 2007 07:51 AM
compare values in one row to the next tholleran SQL Server 2000 7 March 22nd, 2007 04:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.