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

  • SEARCH
  • Home
  • 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 8471813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:53:56+00:00 2026-06-10T16:53:56+00:00

I have a table of data that I’m trying to standardize. The data entered

  • 0

I have a table of data that I’m trying to “standardize”. The data entered into the table wasn’t static or standardized (like with drop-down lists of answers), leaving me with multiple variations of answers where I want a static, universal answer.

For instance, let’s say that there’s a column in the database called “Type of pet”. Because user input wasn’t standardized, people could enter in variations of a specific type of pet, rather than generalized form of the pet. So instead of just entering “Dog”, there are different versions of dogs like “Collie”, “Mutt”, “Labrador”, etc.

How do I go about transcribing these answers into their generalized form — replacing Collie/Mutt/Labrador/etc answers in the table with just “Dog” (or “Cat”, or “Bird”, etc.)?

I realize there needs to be some form of a manually-entered “translation” function. My gut reaction is that a long-spanning list of stacked if-statements would be inefficient, as well as being tedious to control and expand.

Is there some kind of process or system for doing something like this? Like some type of lookup table system/matrix?

I’m assuming a foreach loop to iterate through the array of records would be most appropriate. And then within each iteration of the foreach loop, you’d have it do a test/comparison of the pet variable against some type of list (that I would have created manually) — but what would you use for this lookup table/list? Or this step of the process? Would you have it as some type of a SQL database/table, an array, a CSV file, etc.?

Then, once this comparison is completed and the “translated” equivalent of the type of pet is determined, the foreach loop would update that specific row of the record, either overwriting the old non-standardized value, or perhaps just tacking on the new standardized equivalent into a new column (for later verifying).

  • 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. Editorial Team
    Editorial Team
    2026-06-10T16:53:58+00:00Added an answer on June 10, 2026 at 4:53 pm

    My gut reaction is that a long-spanning list of stacked if-statements
    would be inefficient, as well as being tedious to control and expand.

    100% correct, and because of this you really only have one option: Manually go through the database and clean it up. Once that is done you will need to restrict user input using stop down lists rather than raw text input.

    Depending on your users you might want to look at how Stackoverflow does tags – essentially allowing anyone to do the cleanup for you.

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

Sidebar

Related Questions

I have a table that contains data that I am trying to import into
I have a table that stores data that has been entered regarding the amount
I have a table with a lot of repeated data that I'd like to
I have a table of data that looks like the following: ArtistName TrackName TrackID
I have a lot of data that I'm trying to seed into a polymorphic
I have a table with data that looks like this: create table demo_patient_info (
Say I have a table of data that looks like: ItemNo | ItemCount |
I have a table with weekly data that looks like: userID Site date ------
In SQL Server 2005 I have a table with data that looks something like
I have an Oracle table with data that looks like this: ID BATCH STATUS

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.