Extract in .txt format from a script

Hello - I need help. All scripts that I have created so far, are to extract data in excel format. Could you please tell me how to create a .txt extract from the automated script? Thank you