community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Change the filenames of 330 files based on a certain ID in cell

Meteor

Hi all,

 

I have 330 identical files and I need to change their name based on the info in a certain cell (the location of the cell is always the same in all 330 files).

Attached you find a example excel where the yellow marked cell needs to be target for the filename changing.

I hope you can help me!

 

Kind regards,

 

Mikkel

Alteryx
Alteryx

Hi @Mikkel94 

 

Are these files all stored in the same folder?

 

What I think you'd want to do is use a directory tool to read in all the sheets, then write out a batch file and run that to do the rename.

 

If you let me know the input structure of your folders, I can build a mock up workflow.

Alteryx
Alteryx

Hey @Mikkel94 

 

I put together a workflow that should demonstrate how you can output multiple files based on criteria. I used your example file as well as a similar one I created.

 

I used two input tools and a union. However, I recommend using a wildcard character in the input tool to bring in multiple files at once. (I did this so I could package the data with the workflow.)

 

Pay close attention to the configuration of the output tool (specifically the bottom part of it). This configuration allows you to write multiple output files by grouping o a specific field. In this case, the FileName.

 

Output Multiple Files.png

 

Let me know if there are any other questions !

 

Luke

Alteryx
Alteryx

I have attached the flow that I explain above.

 

Workflow.png

 

Please note that Alteryx will only read the data cell that has the name in, and no others. It will then use windows to rename the file. So all formatting of the workbook will be retained.

Highlighted

@Mikkel94 

 

@LukeG solution is very good and straightforward in simple cases. If you needed to keep the original formatting or other complex situations, @JoeS method of bat commands would be the standard way to go; however, @JosephSerpis had an interesting post about using blobs that would seem to work as well. I've modified @LukeG perfectly working solution to demonstrate the blob method which will maintain formatting.

 

Really I just thought @JosephSerpis blog was awesome and it would possibly solve your use case.

 

 

Atom

An iterative macro is created. Macro screenshot is attached. Let me know if this helps you meet your objective.

Labels