Open a file not knowing the extension
8 views (last 30 days)
Show older comments
Hi,
I need to open some files but their extensions could be different whenever the code is run. Is there any way to open a file without knowing the actual extension, just based on the file's name?
1 Comment
Jonas
on 15 Aug 2022
you could call the uiimport on that file, which can handle many file types. of course you have to choose variables manually
Answers (1)
Image Analyst
on 15 Aug 2022
If you have windows you could do
winopen(filename);
To open it in the program that the operating system considers the default program for opening a file with that extension.
0 Comments
See Also
Categories
Find more on Low-Level File I/O 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!