I am trying to copy SPSS files from one folder into another folder as .csv files. I have several thousand files I am trying to copy and change. How can I do this using alteryx? I have been able to to it using the input and output tools with individual files. Is there a way to do it with several files at once?
Solved! Go to Solution.
Knowing nothing about SPSS files...
You could replicate the process you used for an individual file by creating a batch macro.
You could use a Directory tool to point to your input location and find all the files, and then use a batch macro which reads in a file and then outputs it to the new location. This would be pretty simple to set up (I've attached an example of what i mean that will look for CSV files).
You will need to right click the second tool in the workflow to open the macro and configure the information for a SPSS file, as well as the output tool.
Then you will want to update the path and file name criteria for the Directory tool in the main workflow.
It will remove the initial error you are getting, but is not necessary, as it will be replaced entirely by the batch macro when it is run.
It is not copying all .csv files. It is only copying over one, not sure how it is choosing it and then naming it "output." Is there a way to keep the file names? And why would it only be copying 1 file?
Sorry, for some reason I didn't see notification of this until now!
You will probably want to change the Input tool configuration inside the batch macro so that it has the option to "Output File name as field". Then, you can check off the box at the bottom of the Output Data tool that says "Take File/Table Name from Field", and select the option "Change File/Table Name". Select the "Filename" field from the dropdown and deselect the "Keep Field in Output" checkbox.
That should make it so that it outputs each file as you expect.
Awesome, thank you! That worked!
is there a way to add in a change file name to this same macro?
Hey @kellyreburn and @Claje
Could any of you load an example file? I cannot understand how you can copy multiple files with the provided workflow. I tried to do what you wrote in comments, but nothing worked.
Regards,
Ignas