Here is another example to take frames per second into account. For every sample in your file you will only insert one keyframe (assuming you want to interpolate linear between them).
import bpy
... # read x,y,z and t from a file, assuming seconds for t
# and do something like this in a loop for all keys:
f = bpy.data.scenes["Scene"].render.fps * t + 1 # stub
obj = bpy.data.objects["Cube"] # stub
obj.location = [x,y,z]
obj.keyframe_insert(data_path="location", frame=f)
# make interpolation between keyframes linear
for fc in obj.animation_data.action.fcurves: # stub
for kp in fc.keyframe_points:
kp.handle_left_type = 'VECTOR'
kp.handle_right_type = 'VECTOR'
fc.update()
If you need a higher resolution you could increase the Frame Rate in render settings or come up with a more sophisticated mapping of frames/seconds.
Edit: Assuming you have a file like this:
...
3.0,1.0,3.0,2.666666
1.0,4.0,1.0,5.335345
...
You could use pythons csv module to parse it in Blender like this:
import bpy
import csv
csvf = open('/path/to/values.csv')
rd = csv.reader(csvf, delimiter=',')
for r in rd:
l = [float(x) for x in r]
xyz = l[:3] # location
t = l[3] # time