Copy several files from directory to a new location and change file type
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Awesome, thank you! That worked!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
is there a way to add in a change file name to this same macro?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
