how to record actors' position and attitude and save them as file like .txt ?

I have a car in my game and I recorded a sequence with a sequence.
I want to record the coordinates and orientation of the car at the same time, and save it in a txt file, because I need to use these coordinates to analyze the vehicle’s motion in other programs.
What should I do?