How can I improt a motion file (animation) and then connect a skeleton to a mesh with animation working?
Follow the below steps:


Select your armature (skeleton) and go to the armature panel and hit rest pose
select your mesh and position it to be fitting on top of the armature
while selecting the mesh hit shift+right click to select the armature as well
hit ctrl+p then choose automatic weighting


Now the mesh should be parented and weights assigned automatically with the armature bones.