How do I export XYX loc data as a series of numbers in a text file?

Hello!

I have a ball bouncing around. Every frame is a keyframe. Please could someone show me how do I export the XYZ location (rotation and scale is not necessary) as a long list of numbers in a text file.

Thanks!