how to rename and Copy Zip File from one location to another location

조회 수: 3 (최근 30일)
Srivenkateswaran Narayanan
Srivenkateswaran Narayanan 2019년 12월 24일
댓글: the cyclist 2019년 12월 27일
Hi,
I am working on file management, i need to rename and copy a zip file from one location to anothe location.
i had used the command (copyfile), for the data transfer from one location to another.
Problem:
At the time of Copy, i had same zip file name. so it is taking only one file other file is getting replaced. but i need to have both the files in the same location with renaming.
how to proceed that? can you please help me in this
  댓글 수: 2
David Hill
David Hill 2019년 12월 24일
Why not just take care of it outside of matlab?
Srivenkateswaran Narayanan
Srivenkateswaran Narayanan 2019년 12월 27일
Yes, but i had around 500 Folder and inside every folder i had a ZIP file, all are different data, but some times, in some folder consist of same ZIP name as resemble in another folder but the data are diffrenent, if i wrtie thorugh MATLAB, it is oerwritting, if i do manually it took lot of effort.
so is there any simple way to rename for such kind of scenarios ?

댓글을 달려면 로그인하십시오.

답변 (1개)

the cyclist
the cyclist 2019년 12월 24일
I think you should be able to first use the movefile command to rename the other file.
  댓글 수: 2
Srivenkateswaran Narayanan
Srivenkateswaran Narayanan 2019년 12월 27일
Hello
Thanks
If i tried to move the file to one folder, but i tried to move other file to same folder which is of same name, it is overwriting with previous one. so my first data is not available.
can you sugges me is there any specific command for this ?
the cyclist
the cyclist 2019년 12월 27일
I'm not sure what you want to do if a file of the same name exists. But, you can use the isfile command to check whether the file exists in the location. If it does, then you could use the movefile command to rename it.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by