First create a DTS Package (SQL Server 2000 and older) or an SSIS Package (SQL Server 2005 and newer) which creates the file in the correct format. Then schedule the package to be executed by the SQL Server Agent as a SQL Agent Job.
In the DTS Package click on the Package drop down menu and select schedule. Set the schedule as required and click OK or Save.
In SSIS publish the package to the server, and create a new job with a single job step. Set the job step to SQL Server Integration Services Package and select the package using the available dialogs.