A ` ` catalogues and ` goods processing directory ` two files, article number of the two files are arranged in ascending order, if the goods number consistent
Put the goods name and goods number in the new commodity ` ` booksheet, if the goods number in the catalogue only have also put ` new commodity ` booksheet,
If goods, only there is in processing directory ` ` goods into ` error ` booksheet in
How to handle.
CodePudding user response:
Thinking: refer to merge sort algorithm,According to the different comparison results, control on both sides:
Is read together under a commodity;
Or just read the next goods, on the other side to keep the original goods are compared, and the next
CodePudding user response:
Do it:All will be in the "catalogue" written "new items" table, because according to your requirement description, whether it is unique in the "catalogue", or a total of two files, all want to write this table,
Check some in the "commodity processing directory", only write "wrong" table,
It is recommended to use the Jet database engine, use SQL statements to handle, a kind of method is directly to your all kinds of files as external database to handle; Another method is to first import the original data Access database, after processing, the result data import your object files,
The benefits of the latter are, to write SQL statements the difficulty of the small,
For example:
SELECT the name of goods, number INTO new products FROM your catalogue
SELECT the name of goods, number INTO error FROM goods processing directory WHERE goods, NOT IN the SELECT item number FROM your catalogue
, of course, entirely in circulation processing can also find way, a new commodity lookup USES a heavy cycle, twofold cycle error lookup need