User Activity

I have 3 variables which is from acceletometer. I want to save each data whenever I moved into a .csv file. How can I do it ?