I have downloaded two sheets i.e,
1.7166a12c-4d74-4073-87a4-321b63d7758a-canada.csv
2.7166a12c-4d74-4073-87a4-321b63d7758a-united_states.csv
I need to rename the files i.e, I want to rename them as
Then use ForEach loop activity to iterate one by one file and rename it like this.
ForEach item in csvFiles
fileName = Path.GetFileName(item)
newFileName = fileName.Split("-"c)(5).Replace("_","")
Use **Rename File** activity to rename file and pass source as **item** and Destination as **newFileName**.
Note: Go to Manage Packages and then Go package source and then download Rename File activity.
You need to split the string, keeping “-” as delimiter and get the element of last index.
str = “7166a12c-4d74-4073-87a4-321b63d7758a-united_states.csv” arrayStr = str.Split("-"c) fileName = arrayStr(arrayStr.Length - 1).Replace(“_”,“”) // To get last element which is file name and optionally you can replace “_” with “”