Moving and rotating using CSV
This is a somewhat trivial task given the code is basically already there

Data contained in the same csv with columns like:

loc_x,loc_y,loc_z,rot_x,rot_y,rot_z

import bpy
import csv


f = start_frame = 1
frames_per_row = 10    
csv_path = "C:/Book3.csv"

ob = bpy.context.object

with open(csv_path) as file:
    csv = csv.reader(file, delimiter=",")

    for row in csv:
        ob.location = [float(v) for v in row[:3]]
        ob.rotation_euler = [float(v) for v in row[3:6]]
        ob.keyframe_insert("location", frame=f)
        ob.keyframe_insert("rotation_euler", frame=f)
        f += frames_per_row


If two files need to be used you can either zip them beforehand or keep track using the keyframe. It is also possible to use quaternion rotation.