Convert a (filename.001) to (filename.txt)
55 views (last 30 days)
Show older comments
Hi,
I'm asking for some one who can help me to convertan image file which have an extension .001 to a image file .txt
the name of the file is: 02241625.001
think's ;-)
0 Comments
Answers (2)
Azzi Abdelmalek
on 24 Feb 2014
Edited: Azzi Abdelmalek
on 24 Feb 2014
file1='02241625.001'
file2=strrep(file1,'.001','.txt')
copyfile(file1,file2)
2 Comments
Muhammad Zayed
on 20 Sep 2018
Worked perfectly for my application. I wanted to create an exact copy of (.lvm) file but save it as (.txt) file. Thank you!
Image Analyst
on 20 Sep 2018
You could also look at my answer, which will work for ANY extension, like your .lvm extension, not just .001 extensions.
Image Analyst
on 24 Feb 2014
Try this:
% Create sample filename.
filename = '02241625.001'
[folder, baseFileName, extension] = fileparts(filename)
% Ignore extension and replace it with .txt
newBaseFileName = sprintf('%s.txt', baseFileName)
% Make sure the folder is prepended (if it has one).
newFullFileName = fullfile(folder, newBaseFileName)
It will work for any extension whatsoever. Whatever is there (numbers, letters) gets replaced by txt.
0 Comments
See Also
Categories
Find more on Convert Image Type 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!