Well logically this task is usually solved by writing a custom script that performs this action.
However you said that you have such option and it doesn’t work so I assume you’re looking for any easy ways.
You can use MAGMI for that. It’s free and very fast. In order to accomplish your task you need to:
1) Download “on fly category creator” plugin
2) Create a csv with 2 columns - “sku” and “categories”
3) Enter all your categories in “categories” field with respecting proper format (check out the format of this field here here)
4) Import it with MAGMI
I know it may be tricky for non-pros, so you if adjusting MAGMI appears to be too difficult you can use this plugin which is basically MAGMI integrated into Magento with some extended functionality.
I hope that works.