please see the zip file, first we have to match with mapping file then replace the csv
we have to match file name and replace with prefix than rename the file
Rename File based on the first 5 character of excel. Mapping file available at location C:// Revenue Files.
Append 3 characters in the existing file name.
Eg. File name is VMA01_2019-08-27, The new files will be MAN_VMA01_2019-08-27Assessment (3).zip (59.7 KB)
Not to be mean, but this seems like a test or assessment of some sort…
Usually, I would post the solution XAML here, but in this case, I’ll just explain one way to do this.
Convert the CSV into a dictionary (Step 1 read it to create a data table, Step 2 initialize a Dictionary Step 3 use a For Each Row Activity, to add every row of the data table to the dictionary, using the Invoke Method Activity, with the Add function)
Use “For Each” ad get al all items in the Directory, that has the items you want to rename
Inside the for each first figure out the name of the File, Get the first 5 letters and then use the “Move File” activity to move the file and rename it to Dictionary(first5Letters) + nameOfFile
There, that should be enough. Works perfectly for me
There are other ways of doing it but I think this one with the dictionary is pretty clean.
Feel free to ask any questions if you need more help or post your progress on here
Hi everyone this is my xmal, I am new in automation that’s why asking so many ques,
I m not able to match which mapping file with csv,
because in mapping file two column are thier first name and prefix first we have to match with csv with first name then replace csv with prefix.
Hello Ashish,
In this video I do a lot of stuff with Files (Chapter included) :
1:10 Download the file and Move the latest file to folders
4:30 Rename files with VB commands
6:00 Move files to do Rename
6:55 Delete files
8:15 Delete only PNG files
8:55 Delete all the files except PNG files
9:55 Move files
11:10 Delete files that are older than 2 weeks
14:40 Create a file or folder with dates inside
17:00 Trigger a process when the file is added to a folder
18:45 How to use the files start the process
20:30 Excel Application Scope use files