M
M
microf2020-04-26 12:01:50
PHP
microf, 2020-04-26 12:01:50

How to bring the data to one form?

Good afternoon.
There is a file with a large number of organizations that have different forms of ownership - "Limited Liability Company", "FGUP", "LLC", "Federal State Budgetary Enterprise", "Joint Stock Company", "JSC", "Limited Liability Company". May be misspelled, may be lower case, no spaces, etc.
I would like it all, before recording, and bring the database into one view. Those. on the input "LLC" or "Limited Liability Company" or "Limited Liability Company" and not the output I get clearly "Limited Liability Company".
What algorithm / sorting to use in this case?
Stupidly in the forehead, for example, look for "if the first word reduced to lowercase has the root" general ", then replace it with" Limited Liability Company "or what?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
coderisimo, 2020-04-26
@coderisimo

Use regular expressions. The degree of their sophistication depends on the initial data and your laziness. Highlight common features and replace with what you need.
5ea553d25a14b314612250.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question