Products creating new catagories instead of being added to existing one.

Hi, i am trying to add products from a csv file. I have already created all the categories. For example Newborn Essentials, Fresh Fruits etc. On the csv file everything is mentioned that which product will go to which category. But while importing Categories with the same name are being recreated. The difference is on the permalink(adding an extra -2). And the products are being added to the new category that was created. For example i have added orange and it would be added to fresh fruit category. A new category with same name fresh fruit is being created and orange is being added to that not to the one that was already created. Thus products are not showing on the main category pages. I have more than 3k products and 200 categories. It is not possible to manually edit all these. It used to work fine even 2 days ago. Products used to get added to their mentioned categories. I deleted them and tried to reimport them. Now i am facing the problem.

Source link