You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Change file extension from .wav to .res
4 views (last 30 days)
Show older comments
Hi. My question might sound naive but can u please explain me in detail as to how to change the extension of a file from .wav to .res using MATLAB. P.S. all my files are stored in different names in the same folder
2 Comments
Daniel Shub
on 19 Aug 2011
Do you want to change the extension or change the format? Renaming a file is very different from converting a file.
Answers (4)
Chaowei Chen
on 21 Aug 2011
Supposing you just want to rename the file, do this
! ren temp.wav temp.res
18 Comments
Walter Roberson
on 21 Aug 2011
That is not portable between operating systems.
Chaowei Chen
on 21 Aug 2011
Thanks for the note. I didn't aware that.
However, in Windows, ren is faster than movefile, which copies and deletes files and therefore may be time consuming. My experience. :)
Walter Roberson
on 22 Aug 2011
Can Windows rename be used between different file systems? Can it be used if one of the filesystems is on a networked drive?
The unix-type utility corresponding to rename is "mv". It too is usually much faster than movefile() . The MATLAB definition of movefile() has some odd semantics about the file permissions that result that make the simple and fast "mv" not an exact equivalent. I have not yet been able to come up with a situation in which the movefile() permission semantics would be the desired ones, but I _guess_ there must have been a Good Reason somewhere along the way...
Daniel Shub
on 22 Aug 2011
For renaming you should be able to extrapolate from the second example at:
you can use either the MATLAB movefile command or use the ! to invoke a system command to use your OS built in move/copy/rename command.
Jan
on 23 Aug 2011
This was thought as a comment to Walter's answer, but the "Save" button of the comments is currently not working - on my computer.
This is a C-Mex, which is about 20 times faster than MATLAB's movefile under Windows (I do not have a measurement under Linux): http://www.mathworks.com/matlabcentral/fileexchange/29569-filerename
23 Comments
Arturo Moncada-Torres
on 23 Aug 2011
It is not only in your computer, and it is not only with answers :( . I am getting many errors and not seeing the most recent questions.
Arturo Moncada-Torres
on 23 Aug 2011
It is not only in your computer, and it is not only with answers :( . I am getting many errors and not seeing the most recent questions.
Arturo Moncada-Torres
on 23 Aug 2011
It is not only in your computer, and it is not only with answers :( . I am getting many errors and not seeing the most recent questions.
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)