Dynamic manipulation and separation of individual semiconducting and metallic nanowires