I wrote the code in Python. The code first reads two CSV files: one holding a list of items and their names, and the other containing a list of categories. The code then maps item names to category IDs using a dictionary. Finally, the code loops through the entries in the first CSV file, assigning a category ID to each one based on its name.