Create .txt file and open dialog for saving-path
2 views (last 30 days)
Show older comments
Hello, how can I use the function "writetable" in a way, that it opens a dialog and asks me where to save the newly generated ".txt"-file? With "iuputfile"?
0 Comments
Accepted Answer
Jan
on 29 Jul 2015
You can't. This is a job for uiputfile.
[FileName, PathName, FilterIndex] = uiputfile('*.txt', 'Save table as:');
if ~ischar(FileName)
disp('User aborted the dialog');
return;
end
File = fullfile(PathName, FileName);
writetable(T, File);
1 Comment
Ali Afruzi
on 6 Feb 2021
Thank you @Jan
Someon also can use
[FileName, PathName, FilterIndex] = uiputfile('*.txt', 'Save table as:');
if ischar(FileName)
File = fullfile(PathName, FileName);
writetable(T, File);
else
disp('User aborted the dialog');
end
without using 'return'.
More Answers (1)
See Also
Categories
Find more on Develop uifigure-Based Apps 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!