I have a question about how can I change some files names. The problem is I have this kind of archives, for example:
25614_z.zip
25312_z.zip
25003_z.zip
And I want to create that:
lp_25_614.zip
lp_25_312.zip
lp_25_003.zip
So, I need to automatize this process
lp + 25 (the two first digits) + the number in the 3 4 and 5 position) + dot zip
Is there any way to do it?
EDIT
For example, this would be my condition:
XXXX
if fileNames{k}(3:5) >0 <5 (the interval)= 2
fileNames{k}(3:5)> >5 >10 =10
So, for example:
fileNames{k}(3:5) = 05
after the condition it would be replaced in the rename with= 2
And then I want to add it on the rename name.
newFileName = ['fiche' fileNames{k} (3) 'pd' fileNames{k}(3:5) 'XXX '.tar.gz'];
Is that possible?
You can use
movefileto rename the files:~edit~
Concerning your edit: yes it is possible to generate the file name different for separate cases. Note that the example below is quite clumsy and should only be used if you have only a small number of different cases.