Hi,
I have very huge data which I want to segregate and save in multiple files.
Same Data:
Country | City | Person | Age | Income |
India | Delhi | Ram | 28 | 1000 |
India | Delhi | Sita | 27 | 900 |
India | Delhi | Mohan | 29 | 980 |
India | Mumbai | Mohit | 30 | 950 |
India | Mumbai | Misha | 7 | 0 |
Australia | Sydney | Mark | 20 | 200 |
Australia | Sydney | John | 18 | 150 |
Australia | Perth | Micheal | 45 | 5000 |
Australia | Perth | Eric | 38 | 2500 |
Australia | Perth | Colette | 15 | 350 |
Australia | Melbourne | Isable | 21 | 600 |
US | New York | Mark | 26 | 750 |
US | Washington | Jack | 29 | 800 |
US | Washington | Mike | 24 | 500 |
US | Seattle | Simon | 36 | 3500 |
US | Seattle | Jack | 41 | 4700 |
US | Chicago | Kelvin | 27 | 550 |
US | Chicago | Imran | 33 | 1100 |
US | Chicago | Andy | 55 | 650 |
First I want to create folder with "Country" name. Each "Country" folder should have sub-folder with "City" names. Then each sub-folder should have Files with "Person" name. Like below-
Kindly help me in creating a workflow for this.
Regards,
Mohit
Solved! Go to Solution.
@Emil_Kos I used batch Macro provided in this discussion-
Though I raised a supplemental question too. Please see if you can resolve.
Thanks,
Mohit
Hi @mohit9garg,
I have replied to your post.
I think the error your receive is related to folders that already exist. Maybe you can remove them as the first step of the workflow?
@Emil_Kos Thanks for your help so far.
In Output tool, I selected below option which overwrite the previous file and this solved my problem.
However can we switch off that error, i-e workflow should ignore the error and proceed further.
Can you please amend the batch macro
Hi @mohit9garg
apologies but I don’t have access to my pc. I am not sure when I will be able to take a look.
Hi @mohit9garg,
Apologies but I was thinking about what would be the best approach for this.
The easiest solution for me was just deleting all the old folders. You don't need them anyway and that way you will ensure that you will not get any errors.
The alternative solution that I was thinking of would be much more complicated. I was thinking about using the directory tool and make sure that I am creating only new files for the files that didn't exist and overwrite files for each xlsx that already exists.
I think it is just easier to delete everything and save the files once more.
Hope this will help you!
Thanks Much @Emil_Kos This is a wonderful solution. I was looking for it for such a longtime (but for other workflow)
But for this one, I am more inclined towards using the batch macro as it is solving my "space in folder name" issue. But Can you help me in amending the batch macro a bit. I am getting below error if I delete the original macro & files from my download folder. Is it mandatory to keep those files. (Kindly excuse my ignorance, I have zero knowledge about macros 😞
Hi @mohit9garg,
You need to save this macro in this location:
Just open the macro and click save as and save in the location from the previous screen:
Later you can export the workflow as a package in order to share it without any problems. Thanks to that the workflow will be embedded inside the workflow.
Please let me know if this helped?
Would I need administrator access to my computer to do this?
I am running your macro and its giving me an error that I'm assuming is related to my access:
"Error: Run Command (2): The external program "cmd.exe" returned an error code: 1"