Solved

Finding duplicate records and potential mispellings in an array

Posted on 2011-02-16
5
971 Views
Last Modified: 2012-06-21
Hi There

I have an array of of peoples names

Example
string[] names = new string[] {"Jim Bean","Jack Daniels" ,"Jim Bean" ,"Tim Bean"}

How do I loop through the array to find duplicates.
I also need to know how I can find similar names in the array to find mispelt names as in the example.
pseudo-code will be good enough



Thanks
Stanton
0
Comment
Question by:Stanton_Roux
  • 5
5 Comments
 
LVL 12

Expert Comment

by:starlite551
ID: 34910707
Use can use Oracle To Solve this Issue.. There is a Function in Oracle called Soundex() which Finds Names Which Sound Similar.. So It Would be a good option for you to find duplicates in names..
0
 
LVL 12

Accepted Solution

by:
starlite551 earned 500 total points
ID: 34910738
Also, check out the Difference function in SQL to compare soundexes:

In the first part of this example, the SOUNDEX values of two very similar strings are compared, and DIFFERENCE returns a value of 4. In the second part of this example, the SOUNDEX values for two very different strings are compared, and DIFFERENCE returns a value of 0.

USE pubs
GO
-- Returns a DIFFERENCE value of 4, the least possible difference.
SELECT SOUNDEX('Green'),
  SOUNDEX('Greene'), DIFFERENCE('Green','Greene')
GO
-- Returns a DIFFERENCE value of 0, the highest possible difference.
SELECT SOUNDEX('Blotchet-Halls'),
  SOUNDEX('Greene'), DIFFERENCE('Blotchet-Halls', 'Greene')
GO
0
 
LVL 12

Expert Comment

by:starlite551
ID: 34910748
I think SOUNDEX function is also available in SQL Server.. So try searching for more info about it..
0
 
LVL 12

Expert Comment

by:starlite551
ID: 34910765
0
 
LVL 12

Expert Comment

by:starlite551
ID: 34910775
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now