automatic sorting and moving of files

was wondering if anyone could help me out with this idea I want to execute in SharePoint. so I have created a document directory for data migration, and I want to automate the whole system of uploading docs into these folders. so user A will upload into a temporary folder and then this file is automatically moved to its corresponding folder by a set of rules created.