I am working on a task.
I’ve created the states folder, I’ve also created for each activity to add subfolders within States folder where the folder names are the names of the state from the original .csv file.
So now within C:\…\States\ there are 50 folder each named after a state. How can I add a file named SampleFile.csv to all those folder. Additionally, for all those SampleFile.CSV, how can I include custom data from the original CSV file (see first screenshot)
I feel like I’m really close but being new and lack of skills I’m a little stuck
the original csv has these details alone or has some extra details as well?
us-states-territories.xlsx (13.0 KB)
Here’s the .csv file converted to .xlsx as I couldnt upload it.
I also used Filter Data Table activity and within the activity under Filter Rows tab, I have “Type” = “State” as I only wanted states and assigned new data table. Then I created the for each row activity with the new data table dt_USState
I hope you want to create folder with the name of the states from the csv file and to create a SampleFile.csv to each of these folder. If this is the requirement you can do as below.
- Use excel activity
2)Read range activity ( you will get the datatable o/p)
3)for each row in datatable
4)Create folder activity ("States"+CurrentRow(“Name”).ToString)
5)Create file activity or you can keep a Sample.csv file and copy that to these folders using copy file activity.
Main.xaml (12.9 KB)
Here’s my code, I believe I’ve already done what you’ve mentioned.
I can create the folders, my issue is with placing the sample.csv file in each folder (50 total) and each file should have data for that state only.
For example, in the folder named Alabama, it should have Sample.csv file where column A = Alabama, Column B = Alabama’s capital… and so and that is there for all the states