Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 107227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:43:15+00:00 2026-05-11T01:43:15+00:00

I am doing a CSV Import tool for the project I’m working on. The

  • 0

I am doing a CSV Import tool for the project I’m working on. The client needs to be able to enter the data in excel, export them as CSV and upload them to the database. For example I have this CSV record:

   1,   John Doe,     ACME Comapny   (the typo is on purpose) 

Of course, the companies are kept in a separate table and linked with a foreign key, so I need to discover the correct company ID before inserting. I plan to do this by comparing the company names in the database with the company names in the CSV. the comparison should return 0 if the strings are exactly the same, and return some value that gets bigger as the strings get more different, but strcmp doesn’t cut it here because:

‘Acme Company’ and ‘Acme Comapny’ should have a very small difference index, but ‘Acme Company’ and ‘Cmea Mpnyaco’ should have a very big difference index Or ‘Acme Company’ and ‘Acme Comp.’ should also have a small difference index, even though the character count is different. Also, ‘Acme Company’ and ‘Company Acme’ should return 0.

So if the client makes a type while entering data, i could prompt him to choose the name he most probably wanted to insert.

Is there a known algorithm to do this, or maybe we can invent one 🙂 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:43:16+00:00Added an answer on May 11, 2026 at 1:43 am

    You might want to check out the Levenshtein Distance algorithm as a starting point. It will rate the ‘distance’ between two words.

    This SO thread on implementing a Google-style ‘Do you mean…?’ system may provide some ideas as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here's the code! import csv def do_work(): global data global b get_file() samples_subset1() return
When doing an INSERT with a lot of data, ie: INSERT INTO table (mediumtext_field)
I'm trying to translate an Excel spreadsheet to CSV using the Python xlrd and
I have a web form used for importing data from a CSV file. It
I need to generate a CSV file. Maybe i am 'doing it wrong' because
My code fetches CSV data from a PHP page using httplib. When I open
I've tried to import a csv file into a database by tweaking the modelform
I'm having trouble outputting a data.frame using write.csv using UTF-16 character encoding. Background: I
Doing odd/even styling with jQuery is pretty easy: $(function() { $(.oddeven tbody tr:odd).addClass(odd); $(.oddeven
When doing small icons, header graphics and the like for websites, is it better

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.