I have built a workflow which inputs data in the browser and then downloads a csv file in the downloads folder. This is done multiple times, thus resulting in multiple separate files. I use a for each activity and have managed to download them and move them as a bulk in to the end folder. However, this is not exactly what I’d like to happen.
I need to rename each file after the download and then move them to the end folder. Basically the new name would need to be like this:
new_name = old_name + item from an array + “text” + “item from an array”
Hi @Topias_Stromberg, you can use the move file activit to rename the file
E.g
Array_files =Directory.GetFiles(“folderpath”,”*.pdf”).
Use a for each loop to get all files name , then use a move file activity to rename your file. In move file activity provide the old path and destination path with new name.
I got the move file activity to work to some extent. Meaning I can move the files but can’t rename them in the way I would like to. I have an array of strings which I am inputting to the website. Each iteration results in a new csv file and I would like to name each file with the corresponding items in that array.
What should I put in the “to” field in move file? Currently I’ve tried this:
Thank you. I realized I was a bit unclear what I am doing with the csv files. Currently it has everything in one column with comma as a separator. I need to reform it using the Text to columns feature in excel.
I’m using directory.getfiles activity to store all the file paths into a “my_variable”. Then in a for each activity I have “ForEach item in my_variable”. Then a read csv activity and write range activity. However, this only generates one new file. I have no idea why it stops there?
So, what I am trying to achieve here: I have the downloaded files in the folder “CSV” and in those files all the data is in the column A, thus I need to do something similar than “Text to columns” in Excel. With getfiles I assign all the filepaths into the variable filesNames. Then I use readcsv activity in for each and create datatables. Then, I want to create new excel files into a new folder called “EXCEL”. The variable “helperNumber” is used to file naming purposes only.
By running this workflow I only get one file to the EXCEL folder and then it stops.