Solved

Finding duplicate records and potential mispellings in an array

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 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