Rename file with editfield(App designer)
8 views (last 30 days)
Siria Fumagalli on 20 Nov 2019
I'm using App designer and I'm tryng to change the name of a file with the name writtend on a text edit field.
For example if i have 'oldname.txt' i want to be able to change it in a name i write in an edit field
How can i do it?
Ajay Kumar on 20 Nov 2019
Edited: Ajay Kumar on 20 Nov 2019
You can do this. Suppose you entered 'oldname' in text editfield. i.e.
your_editfield.Value = 'oldname';
now save the file using the name
yourfile = % your character array
size_file = size(yourfile);
doc_name = [your_editfield.Value, '.txt'];
fid = fopen(fullfile(yourpath,doc_name),'w');
for i= 1:size_file(1)