Hello.
Tell me please.

It is necessary to extract data from the existing file (the extension is not XML and the size can be as small as it is large) and written to the database. This should be done in the most rational and fast way possible. I don't need the code, I just need good instruction.

1 answer 1

Instruction

  1. Define the data structure. Try to find a pattern in it. Perhaps this pattern is already spelled out in standard php extensions (xml, yml, json, csv, etc.). So you will save resources and development time.

  2. If the file is nonstandard, then try to find local patterns. For example, blocks are separated by a line break, and inside blocks information is separated by spaces, brackets, and dots. Then use line-by-line reading of the file, and break the line with expload.

  3. Quite a bad case when infa mixed with a bunch of useless information.
    Then you have to look for at least some clues. For example, that the name, surname, patronymic is written in Russian letters immediately before the date of birth.
    Here, too, regulars.

  4. Disgusting case. There is no pattern, the hooks are all the time different.
    Effectively parsing such a text will not work :) Ask for a more structured one.