Solved

Finding duplicate records and potential mispellings in an array

Posted on 2011-02-16
5
958 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

19 Experts available now in Live!

Get 1:1 Help Now