How to change file extension via matlab?
Show older comments
Hello,
I have a question. I would like to change the extension of several files. I mean that in one directory a I have many files in type file1.out., file2.out ,..., file600.out.
I would like to rename these files to *.txt (I mean file1.txt, file2.txt,...., file600.txt) in this directory with one command via matlab?
Could anyone help me?
Accepted Answer
More Answers (2)
Femke Cappon
on 27 Jan 2021
1 vote
Thank you, I have used to code to rewrite LabVIEW .lvm files to .txt
Musaddiq Al Ali
on 6 Dec 2020
Edited: Musaddiq Al Ali
on 6 Dec 2020
Mr. Adam Danz's code is vey nice and neat. I like it. I would like to suggest, to add '\' to the secound lines of the code:-
fileList = dir([directory,'\','*.out']);
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!