Hi, i have a list of files i want to create folders to sort the files according to ID rename the files with ID number and zip it.
E.g put into create
1.pdf ----------> 1folder
2.pdf ---------> 2folder
Hi, you can use the create folder activity with your working directory + “filename” as path, use move file activity to move file into the folder , and then use the Compress/zip file activity to then zip the folder (select folder and provide the file input)
HI @rayz1503
Let take a variable and assign
strFileName = "1.pdf"
We can extract the file name without extension, that will be used as a folder name to create a folder
strFolderName = Path.GetFileNameWithoutExtension(strFileName)
strFolderPath = "....\" + strFolderName
Use Create Folder activity with the proper folder path to create a folder
Just to add on my file name has 3 different part
e.g
abc_1_220223.pdf
i would only wan to extract 1 and create a folder with name 1
it need to be dynamic as i have many files
Hi @rayz1503
If you file name pattern is static, as we want data between _ (underscore). Then we can split the data the fetch the required data between underscore character.
strFileName = "abc_1_220223.pdf"
strFileFullName = Path.GetFileNameWithoutExtension(strFileName)
strFolderName = strFileFullName.Split("_"c)(1).ToString
strFolderName variable will contains 1
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.