real-time coordinate record in csv

hi … I want to know how to record the real-time coordinate of the moving product in excel csv

ex)) 1s (x:0 , y:1 , z:2) => 3s (x:3 , y3 ,z:6)

You would need to develop some script in python or C# that checks the component world position with every interval and then saves this info in a csv file.