+ Reply to Thread
Results 1 to 2 of 2

Levenshtein for strings

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    Aberdeen
    MS-Off Ver
    Excel 2016
    Posts
    60

    Levenshtein for strings

    Hi all,
    I need to combine a lot of different excel workbooks that each one of them have the same column titles e.g. on one workbook the A1 = "Name", B1 = "Surname", C1 = "Phone" etc. But some workbooks have some differences of characters for instance instead of A1 = "Name" to have A1 = "Name_" etc.
    I created a master workbook that contains on the first row the titles that i want to apply to all of the various workbooks: Name, Surname etc. I used the Levenshtein code that I found online to compare the strings with each other and select the one that has the best result e.g. for the Name column to replace any variances of Name_ or Name) with the correct title that exists in my master file i.e. Name, but I haven't been able to get the results so far that i wanted.
    Is there any other way to do this task?
    In case that I decide to take the manual way I will have to open these workbooks one by one and check each title to make sure that these are correctly typed.
    Any help appreciated.

  2. #2
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Levenshtein for strings

    what is the aspect that is slowing you down? I guess opening the files.

    If so - you could get some code to open all the worksheets and record the data in A1 (or whatever cell) from every sheet
    then you can use our fuzzy match to correct them and maybe some further correction by sight to make sure it is correct.

    Then you can use similar code to write the value back to the sheets

    a simple open files loop is

    Please Login or Register  to view this content.
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Similarity according to Levenshtein code- how to ignore deletions/insertions?
    By simz92 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2017, 03:52 PM
  2. [SOLVED] Edit distance (Levenshtein Distance) using Excel
    By cool_anu4u in forum Excel General
    Replies: 4
    Last Post: 10-09-2013, 08:46 AM
  3. excel formula to search Multiple strings in several columns and return strings
    By krratna123 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-13-2013, 11:20 AM
  4. Replies: 1
    Last Post: 08-13-2013, 08:32 AM
  5. Replies: 9
    Last Post: 12-21-2012, 04:18 AM
  6. [SOLVED] Levenshtein Match for Words
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-12-2012, 05:41 PM
  7. Replies: 5
    Last Post: 02-15-2012, 09:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1